SmartClient Version: v13.0p_2023-06-16/AllModules Development Only (built 2023-06-16)
Hello, thank you very much, now it's working, using setImplicitCriteria.
Announcement
Collapse
No announcement yet.
X
-
We've made a change which should fix implicitCriteria on the default "basic" fetchMode - so your original sample in this thread will work as of tomorrow's builds, dated June 15 and later.
Leave a comment:
-
And I see that actually the setImplicitCriteria simplifies the code in the changed handler:
Code:... changed(form, item, value) { employeeTree.setImplicitCriteria({EmployeeStatus: value}, null, true); } ....
Leave a comment:
-
Thanks for the quick reply and the clarification on setImplicitCriteria!
Leave a comment:
-
Yes, you can count on setProperty() to generally execute a setter, if one exists - in this case, though, setImplicitCriteria() has additional parameters which will never be passed by setProperty().
Thanks for the clarification - we'll take a look at "basic" mode in the next day or two and update here when we have it fixed.
Leave a comment:
-
Hello, calling setImplicitCriteria doesn't seem to make a difference.
Also, I've always counted on the setProperty method to call the actual setter if it exists, isn't it the case?
In my actual use case, I've got loadDataOnDemand:false, so a test case like this is closer:
Code:isc.DynamicForm.create({ ID: "aForm", fields: [ { name: "EmployeeStatus", optionDataSource: "employees", displayField: "EmployeeStatus", valueField: "EmployeeStatus", editorType: "SelectItem", changed(form, item, value) { var needsFetch = false; if (!employeeTree.data.implicitCriteria) { needsFetch = true; } employeeTree.setImplicitCriteria({EmployeeStatus: value}); if (needsFetch) { employeeTree.fetchData(); } } } ] }) isc.TreeGrid.create({ ID: "employeeTree", top: 100, width: 500, height: 300, alternateRecordStyles: true, dataSource: "employees", dataFetchMode: "local", fields: [ {name: "SKU"}, {name: "Job"}, {name: "OrgUnit"}, {name: "EmployeeType"}, {name: "EmployeeStatus"} ], dataProperties: { defaultIsFolder: true, parentIdField: "ReportsTo", idField: "EmployeeId", modelType: "parent", loadDataOnDemand: false } });
Instead, dataFetchMode: "local" works (tested in my application), so I could use it at least as a temporary fix, even if it's less efficient than filtering on the server.
Leave a comment:
-
hi claudio ,
Firstly, you should call grid.setImplicitCriteria(), which now exists, rather than setProperty("implicitCriteria", ...). That may fix things for you.
If not - does the sample you showed closely resemble your use-case?
We ask because, while it does look like we may have an issue with dataFetchMode "basic", which is the default mode, you should be able to change the sample to add dataFetchMode: "local", and that should fix implicitCriteria. Similarly, "paged" should also work, as-is.
Please confirm - thanks
Isomorphic Support
Leave a comment:
-
Yes, that's definitely a bug; a regression in fact - we know this was working recently.
We're investigating and will update here when we've fixed it.
Leave a comment:
-
implicitCriteria ignored by TreeGrid
SmartClient Version: v13.0p_2023-06-12/AllModules Development Only (built 2023-06-12)
Chrome on MaxOS
Hello please try the #treeLoadOnDemand sample modified like this:
Code:isc.DynamicForm.create({ ID: "aForm", fields: [ { name: "EmployeeStatus", optionDataSource: "employees", displayField: "EmployeeStatus", valueField: "EmployeeStatus", editorType: "SelectItem", changed(form, item, value) { var needsFetch = false; if (!employeeTree.data.implicitCriteria) { needsFetch = true; } employeeTree.data.setProperty('implicitCriteria', {EmployeeStatus: value}); if (needsFetch) { employeeTree.fetchData(); } } } ] }) isc.TreeGrid.create({ ID: "employeeTree", top: 100, width: 500, height: 300, alternateRecordStyles: true, dataSource: "employees", fields: [ {name: "SKU"}, {name: "Job"}, {name: "OrgUnit"}, {name: "EmployeeType"}, {name: "EmployeeStatus"} ], showFilterEditor: true, filterOnKeypress: true, fetchDelay: 500 });
Is it a bug, or am I missing something?Tags: None
Leave a comment: