jqGrid with automatic height; but has a max height & scrollbars

I would recommend you to set “max-height” property on the bdiv of jqGrid and use height:’100%’ or height:’auto’: $(“#list”).parents(‘div.ui-jqgrid-bdiv’).css(“max-height”,”300px”); The “max-height” property will be not used by IE6, but more recent web browsers will use it. UPDATED: Free jqGrid introduce in version 4.10.0 new property: maxHeight which do exactly the same as above. Thus one … Read more

How to delete rows with local data in jqgrid

You can use delRowData method do delete any local row. You can do use delGridRow from the form editing if you need it. I described the way here and used for formatter:’actions’ (see here, here and originally here). var grid = $(“#list”), myDelOptions = { // because I use “local” data I don’t want to … Read more

How to create jqGrid Context Menu?

There are many context menu plugins. One from there you will find in the plugins subdirectory of the jqGrid source. To use it you can for example define your context menu with for example the following HTML markup: <div class=”contextMenu” id=”myMenu1″ style=”display:none”> <ul style=”width: 200px”> <li id=”add”> <span class=”ui-icon ui-icon-plus” style=”float:left”></span> <span style=”font-size:11px; font-family:Verdana”>Add Row</span> … Read more

JQgrid total amount row

If I understand you correct you want to place in the footer getCol and footerData methods: var grid = $(“#list”), sum = grid.jqGrid(‘getCol’, ‘amount’, false, ‘sum’); grid.jqGrid(‘footerData’,’set’, {ID: ‘Total:’, amount: sum}); The getCol can be used to calculate the sum of all numbers from the ‘amount’ column and with respect of footerData you can place … Read more

Remove vertical lines in jqGrid

jqGrid builds some additional divs over the main grid table. The outer div has the class ui-jqgrid. So if you need to remove right and left border existing over the whole grid you can use the following CSS: .ui-jqgrid { border-right-width: 0px; border-left-width: 0px; } If you need to remove all grid’s borders you can … Read more

JQGrid: Loading data into the footer row

Look at demo http://trirand.com/blog/jqgrid/jqgrid.html and choose on the left tree “New in Version 3.5” and then “Summary Footer Row“. In the example one set footerrow : true, userDataOnFooter : true option of the jqGrid. Then server add userdata block to the data sent back to jqGrid. You can read about userdata in http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data. If userdata … Read more

Setting data attribute on each row of a jqgrid table

You can use rowattr to assign any additional attribute to <tr> elements (see the answer and this one for code examples). For example you can use rowattr: function (rd) { return {“data-mydata”: JSON.stringify(rd)}; } to save full input row data as data-mydata attribute. I recommend you to use rowattr“in combination withgridview: true` option to have … Read more