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
415
Cell leave event and updating cell in current row
posted

I would have thought this to be simple.  I need to, on leave of the cell, trap an event, and make an ajax call ( an item lookup) and upon return load other cells in the row with the results of that lookup.

I have found I can only hook into the blur and valueChanged events which.  Those don't seem to be grid events.  Also, in  valueChanged I need to save off the row index so that my ajax response set the other cells for the current row...however it seems activeRow and activeCell are not set in the grid object.

I have messed with the updating mode and selection mode but neither of these seem to help.

Can someone share a solution?

Update:  I am able to get the activeRow (athough I wonder why it's index is 2 when I am adding the first row)

However, I get this message "Uncaught Error: cannot call methods on igGridUpdating prior to initialization; attempted to call method 'setCellValue'"

When I try in the ajax sucess handler:    grid.igGridUpdating('setCellValue',idx,'description',data.results[0].description);

Parents
  • 2355
    Offline posted

    Hi timjnelson, 

    Thank you for posting in our forums. I have a questions regarding your scenario: what is the editing mode that you are using: row or cell mode? In row mode you can use the editor’s blur event as you discovered already. From there you can get the data-id attribute of the row ( the TR element) which holds the primary key value of the row. And after that you can use this value for setCellValue and update the other editors with the desired data. I’m attaching a sample page that demonstrates my suggestion. Please check it and let me know if it works for you.

    I’m looking forward to your reply. 

    Kind regards,

    Petko Zhekov

    Software Engineer

    sample-updating.zip
Reply Children
No Data