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
830
Sort entire igHierarchicalgrid data on all Levels.
posted

I am sorting locally on igHierarchicalgrid. Sorting feature works only for parent level. I want it to sort child level data as well. 

Is there a way to do this?

Parents
  • 1235
    Verified Answer
    posted

    Hello Jeffrey,

    It could be done. First of all every row should be expanded, so that the child grids are created. Once this is done, on the columnSorted event call sortColumn function to every child grid. In order for this to work the child grids must have the same columns as the parent grid. For example (After every row has been expanded):


    {
        name: "Sorting",
        inherit: true,
        columnSorting: function(evt, ui) {
            var grids = $($("#hierarchicalGrid")[0].rows).find("table");
            for(var i = 0 ; i < grids.length ; i++ ) {
                $("#" + grids[i].id).igGridSorting("sortColumn", ui.columnKey, "ascending");
            }
        }
    }

    Note that this is customly made and might have unexpected behavior in certain cases.

    Feel free to contact me if you have further questions.

    Regards,
    Ivaylo Hubenov
    Entry-level developer

Reply Children
No Data