Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
5 replies
Subscribers
8 subscribers
Views
4125 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
The sort capability isn't working on my grid, and I think it's because o
nickh647
over 9 years ago
The sort capability isn't working on my grid, and I think it's because of how I'm getting the data. Any ideas on how to do this so the sort will work when a user clicks on the column header?
1. Use a!queryEntity to get a datasubset with a batchSize -1 for paging to get all the rows
2. Filter the data and put it into a datasubset with a batchSize of 10 for paging
3. Display the filtered datasubset into a grid.
Here's some sample code:
load(
local!allRowsPaging: a!pagingInfo(startIndex:1, batchSize: -1),
local!gridSelection: a!gridSelection(pagingInfo: a!pagingInfo(startIndex:1, batchSize: 10)),
with(
local!datasubset1: rule!queryEntityFunction(local!allRowsPaging),
local!filteredData: rule!filterData(local!datasubset1.data),
local!datasubset2: todatasubset(local!filteredData, local!gridSelection.pagingInfo),
a!gridField(
totalCount: local!datasubset2.totalCount,
columns:{
a!gridTextColumn(lab...
OriginalPostID-155401
OriginalPostID-155401
Discussion posts and replies are publicly visible
Parents
0
sikhivahans
over 9 years ago
@nickh Afaik following two steps should probably resolve the issue:
1. Using the pagingInfo function with the sort parameter. This will help you load the grid with default sort configuration.
Ex: a!pagingInfo(startIndex: 1,batchSize: -1,sort: a!sortInfo(field: "name",ascending: true()))
2. Using the exact field name as in the datasubset in the gridTextColumn function. I guess you haven't provided a correct value here, because documentation at https://forum.appian.com/suite/help/7.9/SAIL_Components.html#TextColumn says that we should use the field name that populates the data in the 'field' attribute of a!gridTextColumn() component.
Example: a!gridTextColumn(label:"Name", field: "name", data: index(local!datasubset2.data, "name", {})
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
sikhivahans
over 9 years ago
@nickh Afaik following two steps should probably resolve the issue:
1. Using the pagingInfo function with the sort parameter. This will help you load the grid with default sort configuration.
Ex: a!pagingInfo(startIndex: 1,batchSize: -1,sort: a!sortInfo(field: "name",ascending: true()))
2. Using the exact field name as in the datasubset in the gridTextColumn function. I guess you haven't provided a correct value here, because documentation at https://forum.appian.com/suite/help/7.9/SAIL_Components.html#TextColumn says that we should use the field name that populates the data in the 'field' attribute of a!gridTextColumn() component.
Example: a!gridTextColumn(label:"Name", field: "name", data: index(local!datasubset2.data, "name", {})
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data