JQGrid MultiSelect Filter option populate based on column's distinct value

后端 未结 1 1273
逝去的感伤
逝去的感伤 2021-01-26 11:22

I am using JQGrid with Multiselect filter to filter individual columns. Currently I am populating filters(e.g. SkillCategory column) using database master values



        
1条回答
  •  [愿得一人]
    2021-01-26 11:26

    I see that you use the code from my old answer. About your problem: I suppose that you first call filterToolbar which creates the filter toolbar and only later you call setSearchSelect which set new searchoptions.value property. Another possible problem is that you call setSearchSelect before the data will be loaded in the grid. If you use datatype: "local" with data parameter then the data are filled in the grid during creating of the grid. If you use datatype: "json" then you should first load the data from the server and then call setSearchSelect and filterToolbar inside of loadComplete. For example if you use loadonce: true then you can test the value of datatype parameter inside of loadComplete. If the value is "json" then you made initial loading of the data. So you should call setSearchSelect, then if required call destroyFilterToolbar and finally call filterToolbar to create filter toolbar which selects will have all required values.

    0 讨论(0)
提交回复
热议问题