Author Topic: ui.rowData is not defined in editor  (Read 2977 times)

dbadmin

  • Pro Economy
  • Jr. Member
  • *
  • Posts: 67
    • View Profile
ui.rowData is not defined in editor
« on: February 24, 2015, 10:50:52 pm »
Hi,

I'm trying to access ui.rowData in a column editor, and this property doesn't seem to be defined.

 {title:"ID", width:150, dataType:"string",editable: true, dataIndx:"ID",
           editor:{
                 type:'textbox',
               getData:  function (ui)
                {
                   if (ui.rowData != null) // it's always null
                   {
                      var val = 1;
                   }

                }
                }}

I'm using v 2.2.0. Is it a known issue or am I doing something wrong?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: ui.rowData is not defined in editor
« Reply #1 on: February 24, 2015, 11:01:20 pm »
Your code is fine, rowData is not available in editor.getData callback.

you can get rowData from rowIndx by http://paramquery.com/pro/api#method-getRowData method.

inside getData callback:

Code: [Select]
var rowData = $(this).pqGrid( 'getRowData', {rowIndx: ui.rowIndx});