Hello,
I'm going to enhance my grid widget to make the customized Search Bar can have 'exactly the same' loading spinner with the filter embedded in the ListGrid as below while it is loading.
How can I do to make Case 1 has the same loading spinner in Case 2?
Here is how I did to make the search bar work with the ListGrid (set with AutoFetchData)
Case 1: Filter from Search Bar (The Loading Message would NOT be displayed)
Step 1: update the search Bar value
Step 2: trigger ListGrid.refreshData()
=> DataSource.transformRequest(DSRequest dsRequest) would be triggered automatically
=> Use the search Bar value & dsRequest.getCriteria() to compose a SearchCriteria for REST service
=> after received the REST response, execute
DataSource.updateTable(DSRequest dsRequest, List<T> tableList, int totalRows) {
int rowSize = tableList.size();
ListGridRecord[] data = setRecords(tableList);
DSResponse dsResponse = new DSResponse();
dsResponse.setStartRow(dsRequest.getStartRow());
dsResponse.setEndRow(dsRequest.getStartRow() + rowSize);
dsResponse.setTotalRows(totalRows);
dsResponse.setData(data);
dsResponse.setStatus(DSResponse.STATUS_SUCCESS);
processResponse(dsRequest.getRequestId(), dsResponse);
}
Case 2: Filter from the filter editor in the ListGrid (The Loading Message would be displayed automatically)
Step 1: ListGrid would would trigger DataSource.transformRequest(DSRequest dsRequest) would be triggered automatically
=> Use the search Bar value & dsRequest.getCriteria() to compose a SearchCriteria for REST service
=> after received the REST response,execute
DataSource.updateTable(DSRequest dsRequest, List<T> tableList, int totalRows) {
int rowSize = tableList.size();
ListGridRecord[] data = setRecords(tableList);
DSResponse dsResponse = new DSResponse();
dsResponse.setStartRow(dsRequest.getStartRow());
dsResponse.setEndRow(dsRequest.getStartRow() + rowSize);
dsResponse.setTotalRows(totalRows);
dsResponse.setData(data);
dsResponse.setStatus(DSResponse.STATUS_SUCCESS);
processResponse(dsRequest.getRequestId(), dsResponse);
}
I tried to use DSRequest.setShowPrompt(true), but it doesn't work.
I'm wondering, does the loading spinner would only be triggered when the Criteria in the DSRequest is different?
or is there anyway, I can manually trigger the spinner?
I'm going to enhance my grid widget to make the customized Search Bar can have 'exactly the same' loading spinner with the filter embedded in the ListGrid as below while it is loading.
How can I do to make Case 1 has the same loading spinner in Case 2?
Here is how I did to make the search bar work with the ListGrid (set with AutoFetchData)
Case 1: Filter from Search Bar (The Loading Message would NOT be displayed)
Step 1: update the search Bar value
Step 2: trigger ListGrid.refreshData()
=> DataSource.transformRequest(DSRequest dsRequest) would be triggered automatically
=> Use the search Bar value & dsRequest.getCriteria() to compose a SearchCriteria for REST service
=> after received the REST response, execute
DataSource.updateTable(DSRequest dsRequest, List<T> tableList, int totalRows) {
int rowSize = tableList.size();
ListGridRecord[] data = setRecords(tableList);
DSResponse dsResponse = new DSResponse();
dsResponse.setStartRow(dsRequest.getStartRow());
dsResponse.setEndRow(dsRequest.getStartRow() + rowSize);
dsResponse.setTotalRows(totalRows);
dsResponse.setData(data);
dsResponse.setStatus(DSResponse.STATUS_SUCCESS);
processResponse(dsRequest.getRequestId(), dsResponse);
}
Case 2: Filter from the filter editor in the ListGrid (The Loading Message would be displayed automatically)
Step 1: ListGrid would would trigger DataSource.transformRequest(DSRequest dsRequest) would be triggered automatically
=> Use the search Bar value & dsRequest.getCriteria() to compose a SearchCriteria for REST service
=> after received the REST response,execute
DataSource.updateTable(DSRequest dsRequest, List<T> tableList, int totalRows) {
int rowSize = tableList.size();
ListGridRecord[] data = setRecords(tableList);
DSResponse dsResponse = new DSResponse();
dsResponse.setStartRow(dsRequest.getStartRow());
dsResponse.setEndRow(dsRequest.getStartRow() + rowSize);
dsResponse.setTotalRows(totalRows);
dsResponse.setData(data);
dsResponse.setStatus(DSResponse.STATUS_SUCCESS);
processResponse(dsRequest.getRequestId(), dsResponse);
}
I tried to use DSRequest.setShowPrompt(true), but it doesn't work.
I'm wondering, does the loading spinner would only be triggered when the Criteria in the DSRequest is different?
or is there anyway, I can manually trigger the spinner?
Comment