0

jgrid have problem with async:false property

$("#mygrid").jqGrid({

.... ajaxGridOptions : {async:false,.....} // ... });

i set but it does not work...so it works such as accordion ... firstly it loads as this screen first

after mseconds it get this style ... for this bug i try async:false but it does not work it still begins with first screen and then get the second screen form

for viewing source here is demo:click deo

enter image description here

user1688401
  • 1,851
  • 8
  • 47
  • 83
  • Avoid `async: false` at all costs. Please show your code too (to avoid down-votes). – iCollect.it Ltd Oct 14 '14 at 13:53
  • I doubt that we you are seeing is a result of the data loading process. It looks like filter is being created as `` and then you probably have some custom code to apply jQuery UI to it. This code seems to be running way after the data has been loaded and rendered. Can you share some of this code with us? – tpeczek Oct 14 '14 at 14:08
  • @TrueBlueAussie ...i edited guestion.i gave demo link.it just index.html... http://besttweets.net/ thank you – user1688401 Oct 14 '14 at 14:13
  • Could you describe your goal? What is the problem? `ajaxGridOptions : {async: false}` is a way to solve some problem, but which one? The demo uses a modified code of the retro version 4.3.1, which is almost 3 years old. Why? – Oleg Oct 14 '14 at 15:46
  • @Oleg when page load it looks like that (http://i.stack.imgur.com/Dhkq6.jpg) and then it get normal but our customer does not want this...you said it is 3 years old...is that bug fixed?if yes i will try for new version – user1688401 Oct 14 '14 at 16:06
  • @user1688401: Do you remain you what you did in at the same day exactly tree years ago? I can't remind to all the bug fixes made in jqGrid in last tree years. If I open [your demo page](http://besttweets.net/) I don't see the described problem. The picture will be changed to multiselect control practically immediately. You use `searchoptions.value` in the demo. I suppose that you can fix the problem by removing `attr: { multiple: 'multiple'}` and setting `multiple: 'multiple'` attribute on the select **directly** before the line `$elem.multiselect(options);` – Oleg Oct 14 '14 at 16:17

1 Answers1

0

First of all I would recommend you update jqGrid which you use to 4.6.0 from the retro version 4.3.1. I would recommend you to look in the answer which uses Multiselect and jqGrid 4.6.0.

Seconds I suppose that you can fix your problem in the following way. You use currently

stype: 'select',
searchoptions: {
    sopt: ['eq', 'ne'],
    value: 'Admin:Admin;Moderator:Moderator;Yazar:Yazar;Editor:Editor',
    attr: { multiple: 'multiple', size: 10 },
    dataInit: dataInitMultiselect
}

Where the code of dataInitMultiselect seems to come from my old answer. The code contains the line $elem.multiselect(options); which convert <select> with multiple="multiple" size="10" attributes to multiselect control. I suggest that you

  1. remove attr: { multiple: 'multiple', size: 10 }
  2. add the following lines before the line $elem.multiselect(options);
$elem.attr({multiple: "multiple", size: 14});
$elem.find("option").removeAttr("selected");
Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798