CheckBox as jqGrid Filter -
is there chance use checkbox jqgrid filter? assuming, have field values 0 , 1. if checkbox checked filtred value 1, no filtering.
the reason, why 1 don't use checkboxes in filter toolbar, simple: 1 need 3-state checkbox: checked, unchecked , not-defined:
- "checked" state means filtering checked (1 value in case)
- "unchecked" state means filtering unchecked (0 value in case)
- "not-defined" state means no filtering column
because of 1 use property like
stype: "select", searchoptions: { sopt: ["eq", "ne"], value: ":any;1:yes;0:no" }
to have drop-down select element in filter toolbar. texts "any", "yes" , "no", values 1 , 0 can changed values depend on requirements.
updated: jqgrid allows to create custom searching interface usage stype: "custom"
, implementing custom_element
, custom_value
callbacks of of searchoptions
see the old answer , searching dialog. still don't recommend this, because makes things more complex without real benefit user. i'm sure users ask filtering non-checked state: more users more different opinions. select standard interface know , understand it's meaning in same way.
i modified old demo the following demonstrates possibility of stype: "custom"
in searching toolbar. after click on custom control of filter toolbar 1 see picture below:
i used in demo of cause free jqgrid fork of jqgrid - fork, develop staring end of 2014.
Comments
Post a Comment