Hello Abu,
I use this kind of multiselect where the key and value is STRING. I tried to give them a default value but got this error –
Uncaught Error: cannot call methods on multiselect prior to initialization; attempted to call method ‘refresh’
But when I do this code, –
$(“#gs_status > option[value=’Waiting’]”).prop(‘selected’, true);
$(“#gs_status > option[value=’In Progress’]”).prop(‘selected’, true);
$(“#gs_status > option[value=’On Hold’]”).prop(‘selected’, true);
$(“#gs_status”).multiselect();
$(“#gs_status”).multiselect(‘refresh’);
jQuery(“#list1”)[0].triggerToolbar();
The phpgrid table not displaying any data. I’ve tried to attempt many solutions given in this forum and others but all of them is not working. I need this default value to be onload, but is there any other solution to do this? Here I attached the image for my multiselect.
Thanks in advance.
Regards.
Pretty late reply, but if still some one is interested, the correct code to initialize multi-select filter can be seen here in demo.
Demo: http://phpgrid.org/demo/demos/integrations/multiselect-filter.php
Code: http://phpgrid.org/demo/demos/integrations/multiselect-filter.phps
Line 162,166,176