Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
I followed the instructions in the link below to add pagination to grid advanced. It works.
https://www.ptc.com/en/support/article/CS311123
I typically add the following code to add query to grid advanced.
if (query) {
result = Resources["InfoTableFunctions"].Query({
t: result /* INFOTABLE */ ,
query: query /* QUERY */
});
}
For the paginated grid advanced, I tried the code below to match the output infotable, but it's not working. Is there a way to add query to a paginated grid advanced?
if (query) {
result = Resources["InfoTableFunctions"].Query({
t: result.Data /* INFOTABLE */ ,
query: query /* QUERY */
});
}
Solved! Go to Solution.
Hi @Willie ,
If I'm understanding you statement clearly, You need to query based on the main data and split it into pages?
Please take a look on the code snapshot it may hepls you. We added the "Query" snippet at top of the GetPaginatedEntires services with Input - "query" and then we formed the splitted pages row data based on the quired from main infotable - "data" & the serive were executed by 1 more event of "FilterChanged".
If Its not making sense means, Can you please ellaborate your query more for better understanding?
Thanks & Regards,
Arun C
HI @Willie ,
We tried with below given steps were worked for us-
If need query/filter the entires on each pages, after all paginated data are printed on pages means, we created 1 more service with 2 Inputs,
and Output as Infotable as same as in below snapshot to print the data to the GridAdvanced widget.
And bind the service exection events from GetPaginatedEntries - Invoke & Grid Filter Changed.
Thanks & Regards,
Arun C
Hi @Arun_C
The solution provided worked, but it only queried the current page. It did not query the entire infotable. Is there a way to query the entire infotable?
Hi @Willie ,
If I'm understanding you statement clearly, You need to query based on the main data and split it into pages?
Please take a look on the code snapshot it may hepls you. We added the "Query" snippet at top of the GetPaginatedEntires services with Input - "query" and then we formed the splitted pages row data based on the quired from main infotable - "data" & the serive were executed by 1 more event of "FilterChanged".
If Its not making sense means, Can you please ellaborate your query more for better understanding?
Thanks & Regards,
Arun C
Hi @Willie,
Looking at your second code snippet instead of setting the return of the Query to result you should set it to result.Data, if your return from the service follows the support article.
if (query) {
result.Data = Resources["InfoTableFunctions"].Query({
t: result.Data /* INFOTABLE */ ,
query: query /* QUERY */
});
}
Thanks,
Travis
Oops. I missed that. Good catch!