jerry
jerry

Reputation: 183

how to add checkbox in the jqgrid filter search tool bar?

In the jqgrid filter toolbar textbox search is working perfectly.. i want to include the checkboxes instead of textbox for search.

how to create? plz explain me..

thanks in advance..

Upvotes: 1

Views: 6569

Answers (2)

vel pradeep.MS
vel pradeep.MS

Reputation: 604

Jqgrid Search toolbar

There is no option for adding check box in Search toolbar , but we can add a column with values as check box in grid rows

Alternative way :

 It contains the following options for common searching

search,stype,searchoptions,searchrules

stype :

  • It determines the search type of the field. (text and select)

text: create the text element in search toolbar

select: create the select(drop down) element in search toolbar

Example:

I have a grid with the column name system_defined , I want to show the checkbox in each grid row and search toolbar will be shown as a drop down values with multiselect option.

{name:'system_defined',index:'system_defined', edittype:'checkbox', search: true, formatter: "checkbox", editoptions: { value: "1:Yes;0:No"},editable:true, searchoptions: { sopt: ['eq'], value: ":All;1:Yes;0:No" }, stype: 'select'}

Upvotes: 2

Oleg
Oleg

Reputation: 221997

In the filter toolbar you should better use select element with three values: "checked" , "unchecked" and "no filter" (see How can I add a "Select All" option to a jqGrid select toolbar filter?). Of cause you should choose the texts which better corresponds the contain or the name of the column. If you will have only two values like the checkbox has, that you will always have filtering on the column with the checkbox.

Upvotes: 3

Related Questions