Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
845
JQuery row value no longer available after upgrade
posted

Hi there, I've updated my project from IgniteUI 14.1 to 16.1, and JQuery from 1.7.2 to 1.9.1.

In my grid, on the second level, I use the "iggridupdatingeditcellstarted " event to check if the new value is negative, and handle that, as such:

// Get current Row

var row = ui.owner.grid.dataSource.dataView()[ui.owner._rowIndex];

// Calculate new balance

var balance = row.transfer_size_qty - ui.value

// If it will go negative, set to intransit_size_qty

if (balance < 0)

{ ui.value = row.intransit_size_qty; }

In 14.1, this code worked but since updating to 16.1 I get "JavaScript runtime error: Unable to get property 'transfer_size_qty' of undefined or null reference"

In Intellisense, I get "row.intransit_size_qty", but not "row.transfer_size_qty" coming up, yet they both seem to be correctly defined in the grid and the model.

If I add: alert(row.transfer_size_qty) after " var row = ..." its then recognized, but if I remove it, its gone again.

Any ideas what could be causing this?

Thanks Deon

Parents
No Data
Reply
  • 25665
    Offline posted

    Hello Deon,

    Thank you for contacting Infragistics!

    I have done looking into this matter and it seem like ui.owner._rowIndex does not exist anymore so you are unable to use it. Note it is not recommend to use internal methods/members (marked by a leading “_”) as they could possibly change between versions. Instead you would want to use the public methods/members. To get the cell value for comparing/using I would instead recommend using the getCellValue method:

    var cellValue = $("#grid1").igGrid("getCellValue", ui.rowID, “ProductQty”);

    http://www.igniteui.com/help/api/2016.1/ui.iggrid#methods:getCellValue

Children