Skip to Content
1
Jun 29, 2020 at 05:19 AM

Search Children in SAPUI5

524 Views

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.