This topic contains 2 replies, has 2 voices, and was last updated by Alex Taylor 9 years, 2 months ago.
- Topic
Hi there,
Is there a way to listen to the changes to a datagrid with reference to its name. I have a page where there are two datagrids which need to work independently of each other and which need javascript to be triggered every time they change, again individually.
I have included the following code in the datagrid.yml for both datagrids:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546define(['underscore','atfquotes/js/common','oroui/js/mediator','backgrid'],function (_,$,mediator,backgrid) {return {init: function (deferred, options) {options.gridPromise.done(function (grid) {$(document).trigger('atf-grid:load:'+grid.name);console.log('atf-grid:load:'+grid.name);$(document).on('preExecute:refresh:'+grid.name, grid.refreshAction.$el, function() {$(document).trigger('atf-grid:refresh:'+grid.name);console.log('atf:refresh:'+grid.name);});$(document).on('preExecute:reset:'+grid.name, grid.refreshAction.$el, function() {$(document).trigger('atf-grid:reset:'+grid.name);console.log('atf:reset:'+grid.name);});mediator.on('grid_render:complete',function() {// $(document).trigger('locchange');});mediator.on('grid_load:complete',function () {// $(document).trigger('locchange');});// this deferred should be resolved when the builder finished its workdeferred.resolve();});}}});I am however unsure about how to actually callback once any change happens to a datagrid.
Any help would be appreciated,
Alex
The forum ‘OroPlatform – HTML, JavaScript, CSS, Design Questions’ is closed to new topics and replies.