Some quick searching only turns up adding a new row to a jQGrid
via a modal popup with the editable fields.
Can anyone point me to a sample or show me some code that allows you to add a new empty row into the grid itself, at the top?
I have an action column at the rightmost end of the grid in which onRowSelect()
I have a save button appear and I can make that button do the save and refresh the grid I think..
I can't figure out how to click on a 'Add Row' button and add an empty row inside the grid at the top.
One option that I can see is to style the current add row modal to look like a horizontal row and place it to appear like its a row at the top of the grid.
jQGrid Documentation: http://www.trirand.com/jqgridwiki/
If you use datatype:'local' then you can use addRowData method to insert the row with position parameter set to
'first'
. See some examples under http://www.trirand.com/jqgridwiki/doku.php?id=wiki:retrieving_data#array_data.This answer is courtesy of Oleg in my previous question here:
use $("#grid").addRowData(rowid,data, position, srcrowid);
P.S. Have a look at my profile for a number of jqgrid questions and answers.