Forum
15:17
20/12/2011
Hello,
Could someone please explain how to use the dataUrl in conjunction with the filterToolbar. My aim is to get a dropdown box on the filter toolbar which is dynamically loaded from an ajax request. This is fine for editoptions{} and pulls the data correctly.
The problem is that the filter toolbar field always displays a normal textbox. However if i used searchoptions {value:... } then it is fine. It just doesnt seem to work with dataUrl. Am i missing something please? Is this a bug in the system as i think i have followed documentation thoroughly. Any guidance will be appreciated. Thank you.
An example column in colmodel is this:
The Column:
{name:"category_id_link",index:"c.id",editable:true,edittype:"select",width:140,sortable:false,search:true, editoptions:{
dataUrl:"jqGrid/actions/selectbox/sb_menu_categories.php",
stype:'select',
style:'width:95%',
surl:"jqGrid/actions/selectbox/sb_menu_categories.php",
searchoptions:{
dataUrl:"jqGrid/actions/selectbox/sb_menu_categories.php"
}
}},
The Pager:
$("#menugridlist").jqGrid('navGrid','#menugridpager', {search:false}, //options
{height:'auto',width:'auto',reloadAfterSubmit:false, recreateForm: true}, // edit options
{height:'auto',width:'auto',reloadAfterSubmit:false, recreateForm: true}, // add options
{reloadAfterSubmit:false}, // del options
{jqModal:false}, // search options
{height:250,jqModal:false,closeOnEscape:true} // view options
);
The Filter Toolbar:
$("#menugridlist").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false});
10:25
Moderators
30/10/2007
Hello,
The code :
{name:"category_id_link",index:"c.id",editable:true,edittype:"select",width:140,sortable:false,search:true, editoptions:{
dataUrl:"jqGrid/actions/selectbox/sb_menu_categories.php",
stype:'select',
style:'width:95%',
surl:"jqGrid/actions/selectbox/sb_menu_categories.php",
searchoptions:{
dataUrl:"jqGrid/actions/selectbox/sb_menu_categories.php"
}
}},
is wrong. You put searchoptions and stype as part of editoptions which is not correct. Please look the documentation and examples.
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
13:50
20/12/2011
Thank you for your assistance. I moved the searchoptions and stype etc. outside of editoptions, not sure how i missed that one. It all seems to work fine now. Funny how a small comment from someone "in the know" tremendously helps.
One additional query though, is there a way to refresh the searchoptions dropdown list on the filtertoolbar after it is initiated (like how you can do recreateForm: true in the pager edit/add options).
Most Users Ever Online: 715
Currently Online:
34 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66