Hi guys, I am trying to call fetchdata of list grid with the below criteria that we have stored in DB as json using below code.
Below is the JSON which is stored in DB.
Re-constructing the advanced criteria on client from the above json.
These are date field in datasource.
The fetch works but the date field is not populated in filter
I read about JSONDateFormat.LOGICAL_DATE_CONSTRUCTOR but I am not sure how to use it. Kindly suggest what am I missing here. Thanks in advance.
Isomorphic
Code:
AdvancedCriteria cr = grid.getFilterEditorCriteria(); String jsonToSave = cr.toJSON();
Code:
{ "_constructor":"AdvancedCriteria", "operator":"and", "criteria":[ { "operator":"and", "criteria":[ { "fieldName":"needBy", "operator":"greaterOrEqual", "value":"2024-10-23" }, { "fieldName":"needBy", "operator":"lessOrEqual", "value":"2024-10-25" } ] } ] }
Code:
final AdvancedCriteria savedCriteria = StringUtils.isNotEmpty(criteriaJson) ? new AdvancedCriteria(JSONEncoder.decode(criteriaJson)) : new AdvancedCriteria(); getListGrid().fetchData(savedCriteria);
These are date field in datasource.
Code:
<field name="needBy" nativeName="need_by" type="date"/>
The fetch works but the date field is not populated in filter
I read about JSONDateFormat.LOGICAL_DATE_CONSTRUCTOR but I am not sure how to use it. Kindly suggest what am I missing here. Thanks in advance.
Isomorphic
Comment