Hello there,
Is it possible to have the edit form show by default and not the grid first? Or have one section of my page for only the grid, and another section for the form?
Hello,
Currently it is not doable. How ever you can use external form and post data to grid using ajax.
Pasting from faqs.
Q) How to post data using JS code?
Assuming, you are posting to grid with id (list1), here is the sample JS code.
"id" is PK (_empty), "oper" will be "add" for new record. Rest are the table fields in myData.
<script>
auto_add = function ()
{
myData = {};
myData.id = "_empty";
myData.oper = 'add';
myData.invdate = '2013-06-12';
myData.note = 'test2';
myData.total = '22';
myData.client_id = '10';
jQuery.ajax({
url: "?grid_id=list1",
dataType: "json",
data: myData,
type: "POST",
error: function(res, status) {
alert(res.status+" : "+res.statusText+". Status: "+status);
},
success: function( data ) {
}
});
jQuery("#list1").jqGrid().trigger('reloadGrid',[{page:1}]);
}
</script>
<button onclick="auto_add()">Add</button>