Author Topic: cellSave on version 2.0.4 - colIndx shows "undefined"  (Read 2854 times)

wmangus

  • Newbie
  • *
  • Posts: 3
    • View Profile
cellSave on version 2.0.4 - colIndx shows "undefined"
« on: November 10, 2015, 10:26:32 pm »
I need to use the value in a cell to change values in other cells, but when I try to use ui.colIndx, it shows only "undefined".
The code is below:

   $("div#grid3").pqGrid({
      width: 375, height: 275,
      dataModel: dataModel3,
      colModel: colsOption2,
      bottomVisible: false,
      title: "New Single",
      cellSave: function ( event, ui) {
         alert( ui.colIndx);
      }

What am I doing wrong?


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: cellSave on version 2.0.4 - colIndx shows "undefined"
« Reply #1 on: November 11, 2015, 10:12:56 pm »
You can get colIndx from dataIndx

Code: [Select]
  $grid.pqGrid( 'getColIndx', {dataIndx: ui.dataIndx } );

http://paramquery.com/api#method-getColIndx

wmangus

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: cellSave on version 2.0.4 - colIndx shows "undefined"
« Reply #2 on: November 19, 2015, 02:20:45 am »
Thank you for your help. Your solution worked. :)
I tried to use ui.colIndx because it is listed in the documentation of the cellSave event.