Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
dataUrl in searchoptions{} for filterToolbar notused
05/04/2013
15:17
Avatar
adamwatkins
Member
Members
Forum Posts: 4
Member Since:
20/12/2011
sp_UserOfflineSmall Offline

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});

15/04/2013
10:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

15/04/2013
13:50
Avatar
adamwatkins
Member
Members
Forum Posts: 4
Member Since:
20/12/2011
sp_UserOfflineSmall Offline

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).

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
40 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information