Hello,
I'm using Smartgwt 3.0 and SmartClient 8.2 and I have an issue when using expression filter on ListGrid.
My apologies in advance if this bug is already fixed in a nightly build or already answer on this forum, I couldn't find it.
The issue is that expression filters broke when used with large (means lots of columns) grid.
Here is a simple code to reproduce the issue :
And here are the steps to reproduce :
1) filter "field1" with the expression ">50"
2) scroll to field50 and filter with expression "<60"
=> The grid is empty, and if scroll back to field1, the expression of the filter broken and is now "~>50"
Looks like if scroll to a column no longer visible (or cached), the filter lost its property of expression and is changed to String.
Reproduced on Ubuntu 11.10 on both Firefox 13 and chrome 21, dev mode and js compiled mode.
Regards,
I'm using Smartgwt 3.0 and SmartClient 8.2 and I have an issue when using expression filter on ListGrid.
My apologies in advance if this bug is already fixed in a nightly build or already answer on this forum, I couldn't find it.
The issue is that expression filters broke when used with large (means lots of columns) grid.
Here is a simple code to reproduce the issue :
Code:
import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.Record; import com.smartgwt.client.data.fields.DataSourceIntegerField; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.HLayout; public class GridExpressionFilter implements EntryPoint { static final int FIELDNUM = 60; static final int RECORD_NUM = 100; public void onModuleLoad() { SC.showConsole(); final ListGrid listGrid = new ListGrid(); listGrid.setWidth(500); listGrid.setHeight(300); listGrid.setDataSource(new CustomDataSource()); ListGridField[] fields = new ListGridField[FIELDNUM + 1]; ListGridField id = new ListGridField("id", "id", 50); fields[0] = id; for (int i = 1; i <= FIELDNUM; i++) { ListGridField field = new ListGridField("field" + i, "field" + i, 50); fields[i] = field; } listGrid.setFields(fields); listGrid.setAutoFetchData(true); listGrid.setShowFilterEditor(true); listGrid.setAllowFilterExpressions(true); listGrid.draw(); } private class CustomDataSource extends DataSource { public CustomDataSource() { setID("customDataSrc"); DataSourceIntegerField[] fields = new DataSourceIntegerField[FIELDNUM + 1]; DataSourceIntegerField id = new DataSourceIntegerField("id"); id.setPrimaryKey(true); fields[0] = id; for (int i = 1; i <= FIELDNUM; i++) { DataSourceIntegerField field = new DataSourceIntegerField( "field" + i, "field" + i); fields[i] = field; } Record[] records = new Record[RECORD_NUM]; for(int i = 0; i < RECORD_NUM; i ++) { Record record = new Record(); record.setAttribute("id", i); for (int j = 1; j <= FIELDNUM; j++) { record.setAttribute("field" + j, i + j); } records[i] = record; } setFields(fields); setClientOnly(true); setTestData(records); } } }
1) filter "field1" with the expression ">50"
2) scroll to field50 and filter with expression "<60"
=> The grid is empty, and if scroll back to field1, the expression of the filter broken and is now "~>50"
Looks like if scroll to a column no longer visible (or cached), the filter lost its property of expression and is changed to String.
Reproduced on Ubuntu 11.10 on both Firefox 13 and chrome 21, dev mode and js compiled mode.
Regards,
Comment