How can I get the entire colModel for a jqGrid element? I've gone through the source code a bit and also played around with some tests, but nothing seems to return the actual array.
Thanks.
In a nutshell, colNames defines the names of your jqGrid columns on the page, and colModel specifies options for each column (name in the dataset, width, etc). The documentation has more information: colModel Array which describes the parameters of the columns. This is the most important part of the grid.
var myGrid = $('#list'); var rowID = myGrid. jqGrid ('getGridParam', 'selrow'); var cellVal = myGrid. jqGrid ('getCell', rowID, 'colName'); Where colName is the name of column for which you want to find value for that, which you gave to your column in the colModel.
jqGrid support search toolbar mode, where you can have search toolbar on top of each column of the grid. To use, call the filterToolbar method. You can exclude certain columns from appearing in the search options by setting the search property of the respective column to false.
In this step, we are going to add jqGrid Script and CSS reference to index view. This script is added to project when we add jqGrid Grid from NuGet package. After adding Scripts and Css next we need to add table element for reserve the place where the grid should be created.
You can use getGridParam
- just pass the colModel
option:
jQuery("#mygrid").jqGrid ('getGridParam', 'colModel');
You can look at the jqGrid docs for getGridParam
for more information...
So I did figure it out. In the custom navigation button (onClickButton function), I just used :
this.p.colModel
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With