Require sorting in every column in editable grid.

I am already know populating data through Rule expression with sort in one column.

My requirement is to sort every column in editable grid.

Is there any way to do the same.

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Sorting on columns is only supported (directly) in the Read-Only grid component.  In general, having columns dynamically sortable in an Editable Grid is not a very good idea, as it can cause stuff to get shuffled around in a way that will be very hard to debug and support.  What is your use case?

  • Hi Mike,

    I am already fetching data in editable grid with few grid-columns.Before editing any row, I just want to click(or something like that) on any column header to sort data(both asc/desc). This functionality should work for every column present in editable grid.

  • Suppose I edit every column of editable grid,now I want to sort any column of editable grid.The sorting should be made available on every column of editable grid.

  • There is no way to sort by clicking on the column headers in a grid - the editable grid simply doesn't support that functionality.

    That being said, there are some ways to sort the data that are a little hacky, but the right solution can vary based on your use case. Can you give us more information about what your data looks like, why you need to sort, how is the user using this grid, etc?

  •                                                                                                     FYI, Attached is the screenshot.After page load,I can choose from field dopdown any header name and can sort data (asc/desc) with the help of other dropdown(naming ascending) .   

    There are four columns name ID,Name,Department and Salary.

    Now suppose  I edit  in Name,Department and Salary column  .Before save, again I want to sort the data .

    Hope I am able to narrate my issue clearly now.

  • 0
    Certified Lead Developer

    Make all the gridLayoutHeaderCell labels null, or empty string "".  Then create an extra rowLayout and recreate all of your headerCell labels as rich texts.  A new richTextDisplayField for each column.  Now, you can not only have much tighter controls on the display of your headers (it won't look exactly the same, and maybe that's better).  You'll ALSO have the ability to add dynamic links and icons!  You can use that to change the sort of the pagingInfo of the datasubset you use to build the grid.  Make sure it's a rule input or a refresh variable and you should be set.  If you want to, you can even attach up arrow and down arrow icons to the end of your rich text ersatz header.

    That's going to put you through a lot of work to reimplement the same functionality you had on a Paging Grid, but it's doable.