Sorting data in a grid

It seems like the Row Reorder property in the grid model still doesn’t do anything (as of 2024.2), anybody know if this is supposed to work? Or is going to work some day? Yes I know you can create a view and control the sort order that way. That is a ton more work than just being able to set the sort order.
image

2 Likes

I also see this in the documentation but it doesn’t work, i.e., after sorting the grid in app studio, when running the application, the grid is not sorted.

3 Likes

This is super broken.
There’s an entire property missing that needs to be defined in order for it to work. I had to edit the JSON via SQL to get this example working: Kinetic UI Utility - Favorite Menu Items Reorder - Experts’ Corner - Epicor User Help Forum

I had opened a case, but they were dumb and frustrating and I gave up and let it close from inactivity because I don’t have the time or crayons.

11 Likes

As far as I can tell the only client side sort is the grid-sort-set event and even with that it’s difficult to find a trigger on first load. The only bullet in your doc that seems to work is personalization. Columns,sequence and maybe width.

Deeper brief look: the grid component has no sort prop. The grid service has setSort, getSort methods but they’re only called by event broadcasts (assume to raise client sort of underlying control). Seems initial sort via view, rest, BAQ is the only way by-design since there are no props to which one could bind a sort expression. :man_shrugging:

Because, why would you need to set the sort order on a grid? -epicor pms

4 Likes

ok… i will drop this little nugget to you all (:safe_harbor: Safe Harbor statement goes here :safe_harbor: )… Our UI/UX team has been hard at work with some of the grid features, and in current code which should be coming in Kinetic 2025.2, there is this cool sort feature that really works well. I have been playing with it. You click on the column, and it sorts. if you click on another column, it adds a number showing you that it is the second sort. do that to a 3rd, 4th, 5th column and it keeps adding sorts. Double click, and it removes the sort. Single click and it changes the sort direction. I tried this up to 11 column sort (I ran out of fields to sort by so it may go beyond that, but, an 11 column sort is rather ridiculous).

Here is a screenshot of how it looks with a 3 column sort: I first sorted by credit lhold to bring all the credit hold customers to the top. then by customer type, and then an alpha sort of the name.

Many of you voted for this as idea Log In - Epicor Identity and now :safe_harbor: it appears to be something coming soon!

4 Likes

I mean that’s great - multi-level sort is definitely a needed feature. But not at all what I am talking about. I am talking about controlling the sort order in application studio prior to publishing a custom app. This doesn’t appear to be possible right now, outside of completely defining a custom dataview and custom events to populate it, vs just setting the sort order on an existing dataview.

2 Likes

What’s worse is you can set paging at designtime but not initial sort so paging is useless. Only choice is to not do paging, load all rows, and do sort events client side. Both paging and sort should be easily configurable on grid at design time and both execute server-side.

3 Likes

you propbably already know this, but FWIW, you can do server-side sorting in gridModel.providerModel.restParams for some BO Methods such as GetRows and GetList (I believe) like so:

{
	"whereClauseABCCode": "By ABCCode DESC"
}

call:

/Erp.BO.ABCCodeSvc/GetRows?whereClauseABCCode=By+ABCCode+DESC&pageSize=80&absolutePage=1

oddly it’s in a where clause so there’s some legacy parsing going on some where. :roll_eyes: :man_shrugging:

Right but there are a lot of places where the grid isn’t set up that way where you might want to be able to set a sort order.

2 Likes

Very true. inconsistent config across various provider types is a mess.

So support declines to submit this to development because they can’t locate this page in the help. If that isn’t proof the help system is beyond broken I don’t know what is.

2 Likes

Not sure if this will help you but I was able to get the Grid Sort to work from metafx-panel-card-grid > Advanced > View Options > Rest Parms



I already had the whereClause in this location as I was only loading a specific record type in this grid. So I added the “by Key1 DESC” and it worked. I tried the location where jbooker suggested first but could not get that to work.
{
“whereClauseUD100”: “Key2 = ‘KT’ by Key1 DESC”,
“pageSize”: 50,
“absolutePage”: 1
}

Definitely frustrating as previously I sorted the Grid descending in the custom layer and then saved the layout and it worked fine. Recently had to make changes to my grids and found that option no longer worked :scream: So thankful for this user group!

3 Likes

FWIW, As far as I know grid.ProviderModel is ignored if you have one or more View Options. Views are provider models - the way to have many provider models for your grid. Since your grid has a View defined, you make the change there instead of grid.ProviderModel

2 Likes