我正在使用SmartGWT listgrid和数据源,通常我的过滤是触发服务器请求,但有时网格试图在本地过滤数据,然后没有数据显示。不幸的是,我无法分辨导致局部过滤的原因。
我开始调试SmartClient JavaScript代码并找到了该方法 即使更改了过滤条件,模块ISC_DataBinding中的isc_ResultSet__willFetchData有时也会返回false。我希望此方法在更改过滤条件时始终返回true。调试SmartClient非常困难,因为它被混淆了:(
当过滤条件发生变化时,如何强制listgrid始终向服务器发送请求?
列出网格配置:
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 });
答案 0 :(得分:2)
ResultSet resultSetProperties = new ResultSet();
resultSetProperties.setUseClientFiltering(false);
grid.setDataProperties(resultSetProperties);
一天的工作和3行代码:)希望它能帮助别人节省一些时间:))