ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: jtflint on November 01, 2013, 01:12:54 pm
-
I've managed to get regular textarea updates working fine with editor and editModel, with pqgridcellbeforesave, working fine.
My difficulty is getting pqgridcellbeforesave, when specifying a different editor (like 'select', or 'checkbox' under colModel. Im assuming there's a simple way to do this, that Im missing?
Thanks in advance.
Here's some code...
var colModel[
{
title: 'Auto'
,sortable: false
,Width: 70
,dataType: 'bool'
,dataIndx: 'auto'
,align: 'center'
,editor { type: 'checkbox' , cls: 'checkBoxColumn'}
}
...
];
...
var obj {
,editable: true
,editor: { type: "textbox" }
,editModel: {
clicksToEdit: '1',
saveKey: $.ui.keyCode.ENTER, // or 13. http://api.jqueryui.com/jQuery.ui.keyCode/
select: false,
keyUpDown: false,
cellBorderWidth: 0
}
...
};
var $grid = $("#grid").pqGrid(obj);
$grid.on( "pqgridcellbeforesave", function( evt, ui ) {
...
$.ajax(...) //This works right, when this event is fired.
});
-
I don't find anything wrong with your posted code.
Did you press enter or tab after changing value in select list or checkbox.
Could you provide more information about it like when does the event fire or does the event not fire at all. You can put alert or a breakpoint in your event to find out whether that is a problem in the event firing or $.ajax call.
-
hmm, well, I think I have it working by making the following change.
I changed the pqgridcellbeforesave to pqgridcellsave, and that seems to fire for both kinds.
Thanks.
-
walter
pqgridcellbeforesave fires before the cell is saved and pqgridcellsave after it. Sooner or later you would need pqgridcellbeforesave for validations.
You may post your relevant grid code so that the issue can be reproduced.