I have been using jqGrid v4.0 and it’s working perfectly, but since i upgraded to jqGrid v4.4.1, the FilterTolBar does not have the select fields visible anymore.
Here is my code:
<script type="text/javascript">
$(function() {
var grid = $("#grid_container");
grid.jqGrid({
url:'index.php?getData=xml&',
datatype: "xml",
colNames:['id', 'user','sid', 'Status'],
colModel:[
{name:'id', index:'id', width:150, hidden:true},
{name:'user', index:'user', width:150 , stype:'select', editoptions:{value: "Jhon:Jhon;Adam:Adam"}, searchoptions:{sopt:['cn']}},
{name:'sid', index:'sid', width:65 },
{name:'status', index:'status', width:110 },
],
rowNum:20,
rowList:[10,20,100],
pager:'#grid_pager',
sortname: 'user',
sortorder: 'desc',
height:'100%'
})
.jqGrid('filterToolbar' ,{searchOnEnter : true});
});
Thank you for any suggestion.
The current version of jqGrid is 4.4.4. If you have to use the old one you can try to include the same
valuenot only ineditoptions, but insearchoptionstoo. In case of usagefilterToolbarit’s recommended to add additional value with empty value specially for searching. It will allow not filter for the column. So the definition ofusercolumn could be like belowYou should consider to delete hidden
idcolumn becauseidattribute of rows (<tr>elements of the grid) will be assigned based onidattribute of the input data if your fill the data correctly (see the documentation). If you don’t use editing of data you can removeeditoptionsand use onlysearchoptions. I strictly recommend you to use"eq"instead of"cn"for selects. The usage of"cn"will don’t allows you to use options like"a","ab"and"abc"in one select. If the user will choose"ab"both"ab"and"abc"will be chosen. If the user chose"a"then tree options"a","ab"and"abc"will be chosen. So jqGrid will work not like the user expect it.I recommend you additionally include
gridview: truein all grids which you use to improve performance. The usage ofautoencode: trueis also required in the most use cases.