Author Topic: refreshCell getChanges  (Read 6278 times)

jomeihua

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 7
    • View Profile
refreshCell getChanges
« 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;

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: refreshCell getChanges
« Reply #1 on: February 26, 2014, 07:41:36 pm »
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
« Last Edit: February 27, 2014, 12:54:12 am by paramquery »

jomeihua

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: refreshCell getChanges
« Reply #2 on: February 27, 2014, 07:37:01 am »
how can i mention primary key ?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: refreshCell getChanges
« Reply #3 on: February 27, 2014, 07:54:54 am »
primary key can be mentioned similar to this example on line 229

http://paramquery.com/pro/demos/editing

jomeihua

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: refreshCell getChanges
« Reply #4 on: February 27, 2014, 12:55:45 pm »
I am not update immediately,  I want add into update list and save all change list
Is this the fuction i need?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: refreshCell getChanges
« Reply #5 on: February 27, 2014, 04:47:08 pm »
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.