I've come across very strange fetch policy.
When ListGrid has less then three columns it automatically performs another fetch. First one for records 0-75, and another for next 75 records.
I've tried changing multiple options like cache params, datapagesize, autoFetchData, drawAhead and many others.
It even does not matter if there are many fields that user can pick and show.
Two fetches are performed when grid displays one or two columns. Adding third one that will be shown make it work properly again.
What can I do, to prevent this next fetch to be performed??
Tested on SmartGWT Version: v12.0p_2019-08-22
Best regards.
Mariusz Goch
When ListGrid has less then three columns it automatically performs another fetch. First one for records 0-75, and another for next 75 records.
I've tried changing multiple options like cache params, datapagesize, autoFetchData, drawAhead and many others.
It even does not matter if there are many fields that user can pick and show.
Two fetches are performed when grid displays one or two columns. Adding third one that will be shown make it work properly again.
Code:
RestDataSource ds = new RestDataSource(); ds.setDataFormat(DSDataFormat.JSON); ds.setJsonPrefix(""); ds.setJsonSuffix(""); ds.setFetchDataURL("clients,fetch"); DataSourceIntegerField fieldId = new DataSourceIntegerField("id"); fieldId.setPrimaryKey(true); ds.addField(fieldId); ds.addField(new DataSourceTextField("login")); ds.addField(new DataSourceTextField("name")); ds.addField(new DataSourceTextField("surname")); ds.addField(new DataSourceTextField("address")); ds.addField(new DataSourceTextField("address_house")); ds.addField(new DataSourceTextField("address_apart")); ds.addField(new DataSourceTextField("city")); ListGrid listGrid = new ListGrid(); listGrid.setWidth100(); listGrid.setHeight100(); listGrid.setDataSource(ds); listGrid.setAutoFetchData(true); listGrid.setCanPickOmittedFields(true); listGrid.setFields( // new ListGridField("id"), new ListGridField("login") // new ListGridField("name") ); this.addChild(listGrid);
Tested on SmartGWT Version: v12.0p_2019-08-22
Best regards.
Mariusz Goch
Comment