Currently I am using jqgrid to bind data. I have 2 questions: 1) When Multiselect is true, we have a checkbox in the header row which selects all rows irrespective of grouping.
What i am trying to achieve is to have a checkbox at the level of the group header. So each group will have a multiselect checkbox which when checked only checks all the rows in that particular group leaving the remaining groups as it is.
If the checkbox option at the group header is not possible can we have the group header clickable so that we can check all the rows in that group? I found a similar question asked at click here but they are not using jqgrid.
2) My next question is can we embed .gif,.jpg images as part of the data in the columns in jqgrid?
As I am a new user I'm sorry I wasnt able to add snapshots.
Thanks
It is possible to have a checkbox in the group header, but there is no built in functionality for this in jqGrid.
You can add the HTML via the
groupText
property. Then you can code the click listeners for that input outside of the jqGrid configuration. You can have something like this in your jqGrid configuration:Now you have to code the listeners using the jQuery
on
method since the checkboxes will not exist on dom ready.Demo is JSFIDDLE DEMO
As @david suggested, added the checkbox HTML via the groupText property for group header. And write handler for checkbox click/change event.
If parent jqgrid table's id is
grid
, group header rowtr
is withclass ="gridghead_0"
, and the nested group headers' class will followgridghead_1 to gridghead_n
.checkbox click/change handler (JS DOM Ready function)
settings/options for 'multiselect' and 'grouping'
when select-all is checked, to check group header checkbox