Search code examples
javascriptjquerydojonode-webkitdojo.gridx

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?


Solution

  • 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() {
          ...
        });
    });