Im trying to adapt jqGrid add function to my own purposes. I have navButton that I want to make a specific behavior:
- When user click that button, new row, in edit mode appears on the grid.
- When user type data, and click enter, then data is send to server.
Right now, my code looks like this:
.navButtonAdd("#${pagerId}", {
caption: "${resolveMessage('assign')}",
buttonicon: "ui-icon-add",
onClickButton: function() {
if (assignMode == false){
assignMode = true;
$('#${tableId}').jqGrid('addRowData', 0, {});
$('#${tableId}').jqGrid('editRow', 0);
$('#${tableId}').jqGrid('saveRow', 0, function(){ assignMode = false; }, "${assignURL}");
}
},
position:"last"
})
My problem is that saveRow function is not waiting for the end of editRow. It send empty data to server after the button is clicked immediately. How to made saveRow to wait for typed data?