Hi team,
I set a dialog on my pggird cell. And I have function to did some logic when user quit an edit model. And each time I invoke this method by following way:
$("#grid_json").pqGrid({
cellSave: function( event, ui ) {
cellCalculate(ui,"SAVE", 0);
}
});
The "cellCalculate" is my customized method.
And for the dialog, I met a problem, I double click on my cell then the dialog will open, there will be some value in it, I choose some value and click "Add" button to invoke my function on "Add" button, like the following,
$("#div_dialog").dialog({ width: 600,height:500,resizable:false,modal: true,title: "Choose Accessory",
buttons: {
Add: function () {
var resStr="";
var resIdStr="";
var accChooseName = $("#chooseAccName").val();
var accChooseId = $("#chooseAccId").val();
resStr += accChooseName;
resIdStr += accChooseId;
$(this).dialog("close");
setAccessory(resIdStr,resStr);
},
Cancel: function () {
$(this).dialog("close");
$("#grid_json").pqGrid("quitEditMode");
}
},
open: function () { $(".div_dialog").position({ of: "#div_dialog" }); },
autoOpen: false,
close: function(event, ui) {$("#grid_json").pqGrid("quitEditMode");}
});
So when I click Add, I will go to "setAccessory(resIdStr,resStr)" function. I will handle the value in this method.
function setAccessory(idStr, valStr){
accessoryRowData.accessories = valStr;
accessoryRowData.accessoryId = idStr;
accessoryRowData.isEdit = 'edit';
$("#grid_json").pqGrid( "refreshColumn", {dataIndx :'accessories'} );
$("#grid_json").pqGrid( "refreshColumn", {dataIndx :'accessoryId'} );
$("#grid_json").pqGrid( "refreshColumn", {dataIndx :'isEdit'} );
$("#grid_json").pqGrid("quitEditMode");
}
Now when these steps finished, the pggird can't go to my "cellSave" and invoke my "cellCalculate" method.
So do you know why this happened?
I wanted is when the dialog closed I can enter the "cellSave" behavior.
Thank you!