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
275
Can you resort a grid on the client side?
posted

Hi,

Does anyone know how to do a client side resort of the WebDataGrid?

Thank Yoou,

Tracy

Parents
No Data
Reply
  • 33839
    Suggested Answer
    posted

    Hi Tracy,

    This should be fairly easy to accomplish.  Just use the following code.

    var grid = $find("WebDataGrid1");

    var sorting = grid.get_behaviors().get_sorting();

    var col = grid.get_columns().get_column(0);

    sorting.sortColumn(col, 1, true);  // first param is col object, second is sort direction (0-none, 1- asc, 2-desc) and last param is whether to clear other columns' sortings

    sorting.applySort();

    Let us know if you have any other trouble.

    regards,
    David Young

Children