How to set the default column for the search box in jqGrid? -


i have specified columns searchable through colmodel, can't find way specify default column when search box opened.

any appreciated.

there option columns not documented in the list of searching options. wrote the answer , the demo demonstrate how can implement requirement.

updated: if use multiplesearch: true option can follow referenced answer , specify columns option described. corresponding demo find here. if don't multiplesearch: true option don't display searching rule per default can add default rule in filters property of postdata. example the next demo identical previous 1 uses additionally

postdata: {     filters: {groupop: "and", rules: [{field: "amount", op: "eq", data: ""}]} } 

option.

if don't want use multiplesearch: true option 1 have fix small bug in jqgrid able use columns option. 1 have modify the lines (see line 7009 in jquery.jqgrid.src.js) from

} else {     columns = p.columns; } 

to

} else {     columns = p.columns;     cmi = 0;     colnm = columns[0].index || columns[0].name; } 

i post bug report later trirand , hope bug fixed in next version of jqgrid.

the demo demonstrate working of suggested fix.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -