Categories > TinyButStrong general >

performance: ;ope=html;select

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: pfpro
Date: 2007-07-26
Time: 15:04

performance: ;ope=html;select

yo folks

had some performance issues when dealing
with remember selection on a html select box

Instead of using the plug-in, i use a simple if-statement now


<select name="x_country_id">

<option value="0">[var.LANG.choose]</option>

[lst_country;block=begin]

<option
   value="[lst_country.country_id]"
   <!--NEW APPROACH-->
   [var.x_country_id;if [val]='[lst_country.country_id]';then 'selected';else '']>[lst_country.country_title]
</option>

<!--OLD APPROACH-->
<!--<option>[var.x_country_id;ope=html;select]</option>-->

[lst_country;block=end]
</select>


i'm just wondering why there is the plug-in for selection

cheerio
phil
By: Skrol29
Date: 2007-07-26
Time: 15:53

Re: performance: ;ope=html;select


The following is faster:
[lst_country.country_id;if [val]=[onload.x_country_id];then 'selected'; else '']

Or you can use parameter "ondata" with a custom function in order to add a new column in your records.

> i'm just wondering why there is the plug-in for selection
It is told in the documentation and the FAQ that this plug-in in not good for lot of selections.
By: sheepy
Date: 2007-08-15
Time: 12:42

Re: performance: ;ope=html;select

Curious. I have no issue with that, my major issue has always been with big blocks instead of with big selects.

For form remembering, I now usually do it with javascript - check the code from http://www.howtocreate.co.uk/jslibs/script-saveformvalues

The script there does not work well with forms with dynamic fields, so I have already moved onto my own save/load script... but it served me well.