on 06-29-2020 6:19 AM
Hi Techies,
I have a nested table in XML view. I have a search bar and need to search the child element in UI5. My Json structure is like below,
"headerList": [{ "Material": "0950418867", "Plant": "1C03", "MaterialType": "1045", "Procurement": "E", "itemsList": [{ "Component": "87566340", "Description": "Mat1", "Quantity": "10", "Prod": "true", "Cost": "X", "SortString": "1" }, { "Component": "875663401", "Description": "Mat2", "Quantity": "10", "Prod": "true", "Cost": "X", "SortString": "1" }, { "Component": "875663402", "Description": "Mat3", "Quantity": "10", "Prod": "true", "Cost": "X", "SortString": "1" }] }
I using Filter operation to search with material like
"headerList": [{ "Material": "0950418867", "Plant": "1C03", "MaterialType": "1045", "Procurement": "E", "itemsList": [{ "Component": "87566340", "Description": "Mat1", "Quantity": "10", "Prod": "true", "Cost": "X", "SortString": "1" }, { "Component": "875663401", "Description": "Mat2", "Quantity": "10", "Prod": "true", "Cost": "X", "SortString": "1" }, { "Component": "875663402", "Description": "Mat3", "Quantity": "10", "Prod": "true", "Cost": "X", "SortString": "1" }] }
return new Filter({
filters: [
new Filter("Material", FilterOperator.Contains, sQuery),//It's working
new Filter("headerList/itemsList/Component", FilterOperator.Contains, sQuery) //It's not working.
],
and: false
});
When i try to search the Child element like above its not working. Can you please suggest the correct way. Thanks in advance.
Hi Moorthy,
You need to directly use the name of the field to be filtered, in your example, use "Component" in filter condition as below.
new Filter("Component", FilterOperator.Contains, sQuery)
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
10 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.