You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the org.got5.tapestry5.jquery.components.DataTable for showing my data as a table.
I'm using the mode parameter as true. My tml block:
<t:datatable t:id="datatable"
id="datatable"
t:type="grid"
..........
t:mode="true"
..........
class="table table-hover">
If the user has filled in the search filter with some query and has returned 0 rows, the previously rendered rows was not deleted.
I start the debug this situation and found next:
In the DefaultDataTableModel in the public method getResponse(GridDataSource source) has checked on count of the records.
if (records == 0){
......
response.put("aaData", rows);
return response;
}
Why rows and not the new JSONArray()? Ok I looking next and see that rows re-initialized with the previous request
* Re-initialize the JSONArray for the next ajax request
* */
rows = new JSONArray();
But the problem with next. You add the PartialMarkupRendererFilter for the rendering the table cells and using the rows field. The rows field is filled in the method addPartialMarkupRendererFilter after the re-initialize rows!
Please change this line
response.put("aaData", rows);
on the
response.put("aaData", new JSONArray());
Or add the checking rows field
if (rows.length() != 0) {
rows = new JSONArray();
}
The text was updated successfully, but these errors were encountered:
Hi.
I'm using the org.got5.tapestry5.jquery.components.DataTable for showing my data as a table.
I'm using the mode parameter as true. My tml block:
<t:datatable t:id="datatable"
id="datatable"
t:type="grid"
..........
t:mode="true"
..........
class="table table-hover">
If the user has filled in the search filter with some query and has returned 0 rows, the previously rendered rows was not deleted.
I start the debug this situation and found next:
In the DefaultDataTableModel in the public method getResponse(GridDataSource source) has checked on count of the records.
if (records == 0){
......
response.put("aaData", rows);
return response;
}
Why rows and not the new JSONArray()? Ok I looking next and see that rows re-initialized with the previous request
* Re-initialize the JSONArray for the next ajax request
* */
rows = new JSONArray();
But the problem with next. You add the PartialMarkupRendererFilter for the rendering the table cells and using the rows field. The rows field is filled in the method addPartialMarkupRendererFilter after the re-initialize rows!
Please change this line
response.put("aaData", rows);
on the
response.put("aaData", new JSONArray());
Or add the checking rows field
if (rows.length() != 0) {
rows = new JSONArray();
}
The text was updated successfully, but these errors were encountered: