I found how to make filter function in lightning:datatable, and trying to use.
My column has so many items, so I want to make refine search method which can search rows by clicked column's data.
<lightning:input value="{!v.filter}"/>
<lightning:datatable aura:id="table"
id="table"
data="{!v.receive_Data}"
columns="{!v.Columns}"
/>
filter: function(component, event, helper){
let receive_Data= component.get("v.receive_Data");
let filter = component.get("v.filter");
let clickedColumn = component.get("v.clicked_Column");
let results;
try {
const regex = new RegExp(filter, "i");
// filter checks each row, constructs new array where function returns true
//search only from clickedColumn
results = receive.filter(row=>regex.test(clickedColumn));
} catch(e) {
// invalid regex, use full list
}
component.set("v.receive_Data", results);
},
Is there any way to get clicked column's data or label?