vitalets / x-editable

In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
http://vitalets.github.io/x-editable
MIT License
6.51k stars 1.73k forks source link

List limit for select fields? #1158

Closed deltemp closed 4 years ago

deltemp commented 4 years ago

Hello guys!

I'm having trouble with two big selects:

The list format is [{value:'', text:''},...], and it's size can reach up to 41k characters, and, as far as I know, data attribute tags can support about 65K characters. So It shouldn't be an issue...

I've tried it in four ways:

  1. By adding it directly to the data-source tag in the php file that loads all the content;

For 2 and 3: $.post("includes/options.php", {value:newValue}).done(function(data){ options = data; });

  1. tpl: '<select data-field="'+name+'">'+options+'</select> (tried the variable options as HTML <options> and as the above described list format)
  2. source: options,

For 4: $.post("includes/options.php", {value:newValue}).done(function(data){ $('span[data-name="CITIES"]').data('source', data); });

  1. Just updating data-source directly: tpl: '<select data-field="'+name+'"></select>

When I limit the list to a very few items, it works.

So, is there a size limit to the list? How to deal with big and dynamically big lists on editable?

Thanks in advance! Have a great one y'all!