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
8 replies
Subscribers
7 subscribers
Views
2604 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
I am trying to populate grid with result from a!queryEntity. Data loads with one
jayashrib223
over 9 years ago
I am trying to populate grid with result from a!queryEntity. Data loads with one column sorted as mentioned in a!sortInfo. However, sort after clicking on grid column headers is not working. Clicking on header shows arrow and it doesn't throw any kind of error. I have attached the test code for this.
Any help is really appreciated.
Thanks!
QueryEntityGrid.txt
OriginalPostID-144870
OriginalPostID-144870
Discussion posts and replies are publicly visible
0
sikhivahans
over 9 years ago
@jayashrib223 Hi, just had a look at the code you attached. Your code should additionally handle the following - Reload the local!poDataToLoad with fresh values (data and pagingInfo) not only when Search button is clicked, but also when you interact with paging grid (i.e. sorting/ paginating). Rest of the code seems fine. Please do let me know if you have any follow up questions.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jayashrib223
over 9 years ago
Thanks sikhivahans for the inputs. However, I am using pagingInfo inside my a!queryEntity expression and I want to avoid calling expression multiple times. How can I achieve this?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
No problem, please find attached the code with few comments and let me know if you have any follow up questions. Hope that helps you.
QueryEntityGrid.txt
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jayashrib223
over 9 years ago
It worked. Thank you for your assistance!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jayashrib223
over 9 years ago
Noticed that sorting is working now but pagination is not. If I have batchSize=10, then I am getting only 10 records in grid (1-10 of 10 ) in total eventhough I have 18 records(totalCount=18).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
Great!! There are 2 options of doing it:
1. You can pass a batchSize of -1 to the queryEntity rule which getes you all the records in a single go.
OR
2. Call the queryEntity rule upon the change in value of the pagingInfo. (Because you are obtaining a limited set of records which are sufficient for single page initially. So your query rule has to be re-run when you move to next page i.e. next batch should be fetched upon pagination)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jayashrib223
over 9 years ago
Thanks sikhivahans for all your help! It's working now.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
Great!!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel