Using a dynamically generated filter object from a multi-search UI component, the data needs to be filtered based on the criteria. Once the user initiates a search, the data will be filtered accordingly. Below is an example of the filter object and sample data along with the expected output.
var filter = {
city: 'pana',
hospname: 'sara'
};
var data = [
{
"city": "Hot Springs",
"hospname": "St. Vincent Hot Springs",
"version": "VA48A",
"sysid1": "CT67400",
"type": "CompressedFile",
"rowIndex": 0,
"selected": false,
"disabled": true
},
{
"city": "Panama City",
"hospname": "Bay Medical Center",
"version": "VA48A",
"sysid1": "CT67399",
"type": "CompressedFile",
"rowIndex": 1,
"selected": false,
"disabled": true
},
{
"city": "Sarasota",
"hospname": "Sarasota Memorial Hospital",
"version": "VA44A",
"sysid1": "C7393",
"type": "CompressedFile",
"rowIndex": 2,
"selected": false,
"disabled": true
},
{
"city": "DAVENPORT",
"hospname": "Genesis Medical Center",
"version": "VA48A",
"sysid1": "C6333",
"type": "CompressedFile",
"rowIndex": 6,
"selected": false,
"disabled": true
}
];
Desired Output:
[{
"city": "Panama City",
"hospname": "Bay Medical Center",
"version": "VA48A",
"sysid1": "CT67399",
"type": "CompressedFile",
"rowIndex": 1,
"selected": false,
"disabled": true
},
{
"city": "Sarasota",
"hospname": "Sarasota Memorial Hospital",
"version": "VA44A",
"sysid1": "CT67393",
"type": "CompressedFile",
"rowIndex": 2,
"selected": false,
"disabled": true
}]