ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: jomeihua on February 26, 2014, 10:10:22 am
-
$(function() {
...
...
refresh: function () { //조회
$("#grid_editing").find("button.search_btn").button({ icons: { primary: 'ui-icon-search'} })
.unbind("click")
.bind("click", function (evt) {
var $tr = $(this).closest("tr");
var obj = $grid.pqGrid("getRowIndx", { $tr: $tr });
var rowIndx = obj.rowIndx;
selectRow = rowIndx;
var url = "/service/simpleCommand/?mnuGrpID="+$("#mnuGrpID").val()+"&pgmID="+$("#pgmID").val()+
"&viewID=EXM01001C&finalAction=getDivison";
newModalDialog(url, "EXM01001C", 650,600,"yes"); });
...
..
});
function getDivison(data){
var rowData = $("div#grid_editing").pqGrid("getRowData", { rowIndx: selectRow });
rowData['division'] = data.division;
rowData['projectName'] = data.projectName;
$("div#grid_editing").pqGrid("refreshCell", { rowIndx: selectRow, dataIndx: 'division' });
$("div#grid_editing").pqGrid("refreshCell", { rowIndx: selectRow, dataIndx: 'projectName' });
}
my question is the change row not in the change list
var changes = $grid.pqGrid("getChanges", { format: "byVal" }),
addList = changes.addList,
updateList = changes.updateList,
deleteList = changes.deleteList;
-
Please use updateRow method instead of directly making changes in dataModel.data to see the changes in getChanges() ->
updateList
http://paramquery.com/pro/api#method-updateRow
Moreover track should be true and you should mention primary key recIndx
http://paramquery.com/pro/api#option-track
http://paramquery.com/pro/api#option-dataModel-recIndx
-
how can i mention primary key ?
-
primary key can be mentioned similar to this example on line 229
http://paramquery.com/pro/demos/editing
-
I am not update immediately, I want add into update list and save all change list
Is this the fuction i need?
-
I wish you could be more clear with your question.
You need to mention primary key when you are using transactions. updateList & track is also part of transaction.
updateRow works for updating cells/rows with or without transactions.