Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gridx/Dojo & jQuery : Is there a callback when sorting is completed?

enter image description here

This table is generated using GridX / dojo in NodeWebkit. The "[BV][B][V]" are links that are handled by jQuery using class selector. However, once I sort the grid, the listeners are unbinded. How do I reapply the click function? Is there a callback when sorting & rendering is complete?

like image 861
Lord Loh. Avatar asked Nov 20 '25 22:11

Lord Loh.


1 Answers

There is no callback or event that I know of when sorting is complete in gridx.

However, the whole grid is re-rendered when it is sorted or filtered. So you can use something like:

grid.connect(grid.body, 'onRender', function(){
    $(document).on("click", "a.myBVlink", function() {
      ...
    });
    $(document).on("click", "a.myBlink", function() {
      ...
    });
    $(document).on("click", "a.myVlink", function() {
      ...
    });
});
like image 169
mccannf Avatar answered Nov 23 '25 11:11

mccannf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!