on 2021 Nov 03 9:59 AM
Dear Experts:
I am using Object Table control to show the table from Client Data using binding TARGET -> STRING TARGET ->{#Page:Main/#ClientData/#Property:ListOrders}.
It shows the table contents in the Object Table, however it´s single field Search function doen´t work, meaning doesn´t filter as I type values.
This function seem to work ok with EntitySet Binding with OData.
Is it something restricted for this control if use Client Data as a binding? If so is there some workaround suggestions?
Many thanks,
Yergali
Request clarification before answering.
Another option is to still use the standard object table search input but instead of directly binding to the #ClientData you can use a rule. The rule will normally just return the ClientData value but when a search term is input it will re-execute the rule and you can then implement your custom search logic inside the rule and return the filtered sub-set of values.
Here is an example rule where I have the target for my Object Table set to this rule and inside the rule when the user searches I am filtering my Products list (from the Sample service) on Name or Category Name.
/**
* Describe this function...
* @param {IClientAPI} context
*/
export default function GetStringTargetWithSearch(context) {
let target = context.evaluateTargetPath('#Page:Main/#ClientData/#Property:ProductsList');
let searchString = context.searchString;
if (searchString) {
let searchResult = target.filter(prod => { return prod.Name.includes(searchString) || prod.CategoryName.includes(searchString) });
target = searchResult;
}
return target;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.