Hi Isomorphic,
using 12.0p and 13.0p (I'm using 12.0p) I noticed different issues with implicitCriteria / setImplicitCriteria().
I'm coming from SmartGWT, where there is a setImplicitCriteria() in 12.0p and 13.0p.
In SmartClient there seems setImplicitCriteria() to be present only in 13.0p DataBoundComponent. 12.0p ListGrid only knows attribute implicitCriteria, but this is IRW, so settable.
At least this is what is doc'd, the method seems to be existing anyway in 12.0p. I'm using the method also in 12.0p, if that's not allowed, I can adjust the testcase here.
Please this modified testcase (always using setImplicitCriteria()) which has problems in both versions (v12.0p_2022-03-31, v13.0p_2022-04-02), but less problems in 13.0p.
12.0p:
Best regards
Blama
using 12.0p and 13.0p (I'm using 12.0p) I noticed different issues with implicitCriteria / setImplicitCriteria().
I'm coming from SmartGWT, where there is a setImplicitCriteria() in 12.0p and 13.0p.
In SmartClient there seems setImplicitCriteria() to be present only in 13.0p DataBoundComponent. 12.0p ListGrid only knows attribute implicitCriteria, but this is IRW, so settable.
At least this is what is doc'd, the method seems to be existing anyway in 12.0p. I'm using the method also in 12.0p, if that's not allowed, I can adjust the testcase here.
Please this modified testcase (always using setImplicitCriteria()) which has problems in both versions (v12.0p_2022-03-31, v13.0p_2022-04-02), but less problems in 13.0p.
Code:
isc.DynamicForm.create( { ID: "filterForm", width: 300, operator: "and", saveOnEnter: true, dataSource: worldDS, submit: function() { filterGrid.filterData(filterForm.getValuesAsCriteria()); }, fields: [ { name: "countryName", title: "Country Name contains", wrapTitle: false, type: "text" }, { type: "blurb", defaultValue: "<b>AND</b>" }, { name: "population", title: "Population smaller than", wrapTitle: false, type: "number", operator: "lessThan" }, { type: "blurb", defaultValue: "<b>AND</b>" }, { name: "independence", title: "Nationhood later than", wrapTitle: false, type: "date", useTextField: true, operator: "greaterThan" }] }); isc.ListGrid.create( { ID: "filterGrid", width: 850, height: 300, alternateRecordStyles: true, dataSource: worldDS, autoFetchData: true, useAllDataSourceFields: true, fields: [ { name: "countryCode", width: 60 }, { name: "government", title: "Government", width: 95 }, { name: "independence", title: "Nationhood", width: 100 }, { name: "population", title: "Population", width: 100 }, { name: "gdp", title: "GDP ($M)", width: 85 }] }); isc.IButton.create( { ID: "europeAsiaBtn", title: "Europe/Asia", click: function() { filterGrid.setImplicitCriteria( { _constructor: "AdvancedCriteria", operator: "and", criteria: [ { fieldName: "continent", operator: "inSet", value: ["Europe", "Asia"] }] }); } }); isc.IButton.create( { ID: "europeAsiaAusBtn", title: "Europe/Asia/Aus", click: function() { filterGrid.setImplicitCriteria( { _constructor: "AdvancedCriteria", operator: "and", criteria: [ { fieldName: "continent", operator: "inSet", value: ["Europe", "Asia", "Australia/Oceania"] }] }); } }); isc.IButton.create( { ID: "allCtnBtn", title: "All continents", click: function() { filterGrid.setImplicitCriteria(null); } }); isc.IButton.create( { ID: "filterBtn", title: "Filter", click: function() { filterForm.submit(); } }); isc.IButton.create( { ID: "refreshBtn", title: "refreshData()", click: function() { filterGrid.refreshData(); } }); isc.IButton.create( { ID: "fetchBtn", title: "fetchData()", click: function() { filterGrid.fetchData(); } }); isc.IButton.create( { ID: "invalidateBtn", title: "invalidateCache()", click: function() { filterGrid.invalidateCache(); } }); isc.HStack.create( { ID: "criteriaBtnStack", membersMargin: 30, height: 1, members: [ isc.Label.create( { contents: "Implicit Criteria:", height: 1 }), europeAsiaBtn, europeAsiaAusBtn, allCtnBtn ] }); isc.HStack.create( { ID: "reloadBtnStack", height: 1, membersMargin: 30, members: [ isc.Label.create( { contents: "Different reloads:", height: 1 }), refreshBtn, fetchBtn, invalidateBtn ] }); isc.VStack.create( { membersMargin: 30, members: [ filterForm, filterBtn, criteriaBtnStack, reloadBtnStack, filterGrid ] });
- Click the different Implicit Criteria buttons to notice that only looser criteria result in a new fetch. More strict criteria will only be applied with the next refreshCache() / invalidateCache(). fetchData() does not have an effect.
- "All continents" button after other criteria buttons has no effect, only applied with the next refreshData(). invalidateCache() / fetchData() then result in a fetch with the old criteria.
Best regards
Blama
Comment