Hi Isomorphic,
creating this testcase today I wondered about the (expected) duplicated entries in the "Government"-SelectItem and came up with this solution here in this modified sample (SNAPSHOT_v13.1d_2024-06-06, but basically all versions):
With the "Government"-SelectItem as it is one only has every entry once, thanks to the groupBy, which is great.
You can also see in the RPC-Tab that government is the only field that is returned (of course necessary for a groupBy).
But when you select an entry and open the SelectItem again, a different entry is selected (here "British crown dependency").
I assume this is due to pk being the primaryKey field and pk missing in the data. So it makes sense that it is this way right now and is no bug in my opinion.
But would there be a way to make this problem go away clientSide? Perhaps by transparently creating another clientOnly DataSource with government as primaryKey?
Also, is this really the only way to set the requestProperties? This seems awfully deep nested. Is there no (fetch-)properties on SelectItem- or ListGrid level?
ListGrid has saveRequestProperties, but no "normal" (fetch-)RequestProperties.
Best regards
Blama
creating this testcase today I wondered about the (expected) duplicated entries in the "Government"-SelectItem and came up with this solution here in this modified sample (SNAPSHOT_v13.1d_2024-06-06, but basically all versions):
With the "Government"-SelectItem as it is one only has every entry once, thanks to the groupBy, which is great.
You can also see in the RPC-Tab that government is the only field that is returned (of course necessary for a groupBy).
But when you select an entry and open the SelectItem again, a different entry is selected (here "British crown dependency").
I assume this is due to pk being the primaryKey field and pk missing in the data. So it makes sense that it is this way right now and is no bug in my opinion.
But would there be a way to make this problem go away clientSide? Perhaps by transparently creating another clientOnly DataSource with government as primaryKey?
Also, is this really the only way to set the requestProperties? This seems awfully deep nested. Is there no (fetch-)properties on SelectItem- or ListGrid level?
ListGrid has saveRequestProperties, but no "normal" (fetch-)RequestProperties.
Best regards
Blama
Code:
isc.ListGrid.create({ ID: "filterGrid", width: 850, height: 500, alternateRecordStyles: true, dataSource: worldDS, autoFetchData: true, groupByField: "continent", groupStartOpen: "all", sortField: "continent", groupByMaxRecords: 190, showFilterEditor: true, sortByGroupFirst: "true", implicitCriteria: { _constructor: "AdvancedCriteria", operator: "and", criteria: [{ fieldName: "continent", operator: "inSet", value: ["Africa", "Asia", "Australia/Oceania", "Europe", "North America", "South America"] }] }, fields: [{ name: "countryCode", width: 60 }, { name: "countryName", }, { name: "government", filterEditorProperties: { type: "SelectItem", sortField: "government", multiple: true, pickListProperties: { dataProperties: { requestProperties: { groupBy: "government" } } } }, }, { name: "continent", }, { name: "capital" }] }); // Implicit criteria Buttons isc.IButton.create({ ID: "europeAsiaBtn", width: 250, title: "inSet: AF/AS/AU/EU/NA/SA (=all)", click: function() { filterGrid.setImplicitCriteria({ _constructor: "AdvancedCriteria", operator: "and", criteria: [{ fieldName: "continent", operator: "inSet", value: ["Africa", "Asia", "Australia/Oceania", "Europe", "North America", "South America"] }] }); } }); isc.IButton.create({ ID: "europeAsiaAusBtn", width: 250, title: "inSet: AS/AU/EU/NA/SA", click: function() { filterGrid.setImplicitCriteria({ _constructor: "AdvancedCriteria", operator: "and", criteria: [{ fieldName: "continent", operator: "inSet", value: ["Asia", "Australia/Oceania", "Europe", "North America", "South America"] }] }); } }); isc.IButton.create({ ID: "allCtnBtn", width: 250, title: "All continents (null criteria)", click: function() { filterGrid.setImplicitCriteria(null); } }); isc.HStack.create({ ID: "criteriaBtnStack", membersMargin: 30, height: 1, members: [ isc.Label.create({ contents: "Implicit Criteria:", height: 1 }), europeAsiaBtn, europeAsiaAusBtn, allCtnBtn ] }); isc.VStack.create({ membersMargin: 30, members: [ criteriaBtnStack, filterGrid ] });
Comment