jQuery UI Widgets › Forums › Grid › Get filter element from specific column
This topic contains 3 replies, has 3 voices, and was last updated by mr_kirkwood 7 months, 1 week ago.
-
Author
-
I’m using angular 7 and I need to get filter input from a specific column on filter callback function to organize filter data but couldn’t find a way to do it.
Any ideas on how could I retrieve filter element from a specific column?
I can’t use getfilterinformation function, once I call it filter seems to stop calling filter callback function I didn’t find the reason but seems lime grid crushes somehow, without throws any exception.
- This topic was modified 4 years, 9 months ago by areisyus.
Hello areisyus,
Can you, please, check the following Example.
You retrieve the value of the filter input inside theonFilter
event handler.Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/I can get the onFilter to work. I would like to be able to grab other data from the onFilter results.
https://www.flickr.com/photos/mr_kirkwood/52690885929/in/dateposted-public/
I would like to be able to get the building ID as well. The above code gives me only the filter from the dropdown select field (Building Name). Is there anyway to get this data?
- This reply was modified 7 months, 1 week ago by mr_kirkwood.
I figured out a way around. I get the Filter data, then I passed it into another query to match the name to get the ID I was looking for.
` $ (‘#roomsSortTable’).on (‘filter’, function (event)
{
let filters = event.args.filters;
if (filters.length > 0) {
console.log (filters[filters.length – 1].filter.getfilters ()[0].value);
tableFilterDataText = filters[filters.length – 1].filter.getfilters ()[0].value
console.log (tableFilterDataText)
getBuldingNameText = tableFilterDataText;
console.log (getBuldingNameText);
improvementTableData.filter (c => c.LONGNAME === getBuldingNameText).forEach (function (d)
{
console.log (d);
console.log (d.BUILDINGID);
getBuildingIDText = d.BUILDINGID;
});
} else {
console.log (“undefined”)
}
});Thanks!
-
AuthorPosts
You must be logged in to reply to this topic.