function service_add(grid) { var rowIndx = 0; id = 200; $("#services_grid").pqGrid("addRow", { newRow: { id: id, service_date: "2016-12-13" }, rowIndx: rowIndx, rowIndxPage: 0 }); //show the update and cancel . var $tr = grid.getRow({ rowIndx: rowIndx }), $btn = $tr.find(".save_btn"); $btn.button("option", { label: "Save", "icons": { primary: "ui-icon-check" } }) .unbind("click") .click(function(evt) { return service_save(rowIndx, grid); }) .show(); //$("#services_grid").pqGrid("refresh"); grid.addClass({ rowIndx: rowIndx, cls: 'pq-row-edit' }); grid.editFirstCellInRow({ rowIndx: rowIndx });}
$btn.button({ label: "Save", "icons": { primary: "ui-icon-check" } }) .unbind("click") .click(function(evt) { return service_save(rowIndx, grid); })