Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
@KK,

K_TBL_FIELDS has a column 'opt_selected', which has TINYTEXT definition. Is it safe to make it TEXT?

Currently I have a checkbox editable and wish to have some flexibility with naming my values. If I use bare numeric minimum for values (1, 2, 3, .. ) then less than 100 such numeric values would already hit the limit, taken into account that values must be enclosed with 1 symbol from both sides to be correctly used later in custom_field filtering (100, 101, ... ,999).

TLDR
I will add to this question some description of the usecase to prevent any ranting about 'this is not for everybody'. :lol: Actually, everybody can have some kind of form (as I am now), which may have 100-200 YES/NO answers. Making such a form with separate checkbox editable for each question row has proved itself inconvenient, given the amount of background calculations Couch does upon each page load. So even 300 editables in a template is overkill for it (slows down dramatically). SO, my optimisation now includes making it ONE editable with multiple options and take care of the rest (packing multiple regular 'unbound' inputs together into one list of values) with my code in k_success.

Thanks.
unlimited time premium coding support $99 per project - PM or email me or discuss in topic
active topics
Don't see any problem with that.
Go ahead and make the change. Share your findings with us.
I have successfully managed to get 400 values. It was somewhat bulky road, as I had to check with database why some values just were not appearing. It occurred that there were some spaces and newlines among opt_selected values as well as opt_values data.

My newly revised cms:trim viewtopic.php?f=8&t=10372 helped immensely to get this sorted out and since that it was all working just amazingly fast.
With 250 editables instead of almost 600, page went from absolutely unresponsive to 1 sec load. Nice job.

Some code to spice it up. Editable:

Code: Select all


CHECKBOX
<cms:editable name='checkboxes' label='Checkbox OK' desc='' type='checkbox'
                opt_values="<cms:trim "
                            <cms:repeat count='400' startcount='101' >
                                check_<cms:show k_count /> = <cms:show k_count />
                                <cms:if k_count lt '500' >
                                    <cms:set mod = "<cms:mod k_count '5' />" />
                                    <cms:if mod eq '0' >||<cms:else />|</cms:if>
                                </cms:if>
                            </cms:repeat>" />"
                opt_selected=''           
                order=''
                group='group_form_1'  />



Look in backend, auto-arranged with max 5 checkboxes per row

ScreenCut-12-13---20-25-16-.png
ScreenCut-12-13---20-25-16-.png (14.7 KiB) Viewed 938 times
unlimited time premium coding support $99 per project - PM or email me or discuss in topic
active topics
Care to also post a screenshot of how the resulting form looks like?
OK, I am posting a sample screen. It's just a checklist with about 200 rows (see scrollbar).
Not the biggest one. There currently are about 100 checklists like that, with the largest one having about 350 rows.

P.S. For anyone interested, to display a checkbox like that, without label, make opt_values=' =1'

Attachments

unlimited time premium coding support $99 per project - PM or email me or discuss in topic
active topics
5 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests