I'm using SmartGWT listgrid with datasource and normally my filtering is triggering server request, however sometimes grid is trying to filter data locally and then no data is displayed. Unfortunately I'm unable to tell what causes local filtering.
I started debugging SmartClient JavaScript code and found out that method isc_ResultSet__willFetchData from module ISC_DataBinding is sometimes returning false even if filtering criteria is changed. I want this method to always return true when filtering criteria is changed. It is very hard to debug SmartClient because it is obfuscated :(
How can I force listgrid to always send request to the server when filtering criteria is changed?
list grid confuguration:
grid.setShowRecordComponents(true);
grid.setShowRecordComponentsByCell(true);
grid.setWidth100();
grid.setHeight100();
grid.setShowAllRecords(false);
grid.setCellHeight(22);
grid.setAutoFetchData(false);
grid.setCanEdit(true);
grid.setAutoSaveEdits(false);
grid.setShowFilterEditor(true);
Button filterButtonProperties = new Button();
filterButtonProperties.setVisible(false);
grid.setFilterButtonProperties(filterButtonProperties);
grid.setAllowFilterExpressions(true);
grid.setFilterEditorHeight(22);
grid.setDataPageSize(30);
grid.setRowEndEditAction(RowEndEditAction.DONE);
grid.setListEndEditAction(RowEndEditAction.NEXT);
grid.setConfirmDiscardEdits(false);
grid.setUseAdvancedFieldPicker(true);
grid.setAdvancedFieldPickerThreshold(0);
grid.setFieldPickerFieldProperties(new String[] { "frozen", "decimalPrecision" });
grid.setAutoFitFieldsFillViewport(true);
grid.setCanHover(true);
grid.setShowHover(true);
grid.setShowClippedValuesOnHover(true);
grid.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATE);
grid.setDateInputFormat("DMY");
ResultSet resultSetProperties = new ResultSet();
resultSetProperties.setNeverDropUpdatedRows(true);
grid.setDataProperties(resultSetProperties);
grid.setSelectionType(SelectionStyle.SIMPLE);
grid.set gridComponents(new Object[] { List gridComponent.FILTER_EDITOR, List gridComponent.HEADER,
List gridComponent.BODY });
Found it! I was abe to figure out what is going on under the hood by replacing obfuscated code with version for debuging that is avaliable in this location: SMARTGWT\com\smartclient\debug\public\sc\ I must say it is very useful. I had to disable client-side filtering because it differs from server-side filtering. This is how it can be done:
ResultSet resultSetProperties = new ResultSet();
resultSetProperties.setUseClientFiltering(false);
grid.setDataProperties(resultSetProperties);
One day of work and 3 lines of code :) Hope it will help someone save some time :)