Cjxcz Odjcayrwl
Cjxcz Odjcayrwl

Reputation: 22847

Dojo GridX row/cell change listener?

I'm using Dojo 1.9 and GridX 1.2. I'd like to detect the event that given row (or cell) has been changed by the user. Then additional action would be done, for example a row would change background color and the "Save" button would be enabled.

I was searching for the examples and in documentation, but I haven't found an example. How to register a listener reacting to edits in the grid, that would give me information what row or what cell has been edited, with the possibility of reading actual value after change?

Upvotes: 1

Views: 2925

Answers (1)

Cjxcz Odjcayrwl
Cjxcz Odjcayrwl

Reputation: 22847

The event is called 'onApply' and is registered on grid.edit (Module-Edit reference)

The example code to achieve that:

grid.edit.connect(grid.edit, "onApply", function(cell, success) {
    var item = cell.row.data()
    var id = cell.row.id
    console.log('Row with ID '+id+' is modified. New value: '+item)
})  

Upvotes: 1

Related Questions