I'm currently trying to add a search filter on a column in handsontable. I can use the callback
of the search plugin to hide the rows with css but that breaks scrolling. The search plugin also seems to only look at the first 100 or so of a table.
Is there any plugin that exists that adds row filtering to handsontable?
标签:
handsontable
相关问题
- Table filter not working with backspaces
- Refresh a handsontable
- Customize Handsontable Scroll Bar Design
- Connect HandsonTable to MySQL server
- Handsontable Save formula values
相关文章
- Customize Handsontable Scroll Bar Design
- Connect HandsonTable to MySQL server
- Handsontable Save formula values
- Save JQuery Handsontable to an excel file on serve
- CSS applied on Handsontable grid row on Scroll is
- Meteor Handsontable example
- Update handsontable by editing table and/or eventR
- Handsontable使用时,不完全呈现Chrome浏览器内置的搜索功能(Handsontable
I'm not a JS expert, but there is a basic example using http://jsfiddle.net/awyjnbj6/ . This is an answer to my question at Table filter not working with backspaces .
This includes:
I have a requirement to do something similar. After some googling I found the following demo:
http://my-waking-dream.blogspot.co.uk/2013/12/live-search-filter-for-jquery.html
However I'd be interested to know if anyone has other approaches that play friendly with column sorting.
As far as I know, the search plugin will search all rows but only highlight them, and only the ones the get rendered. This means that because of lazy rendering (HOT only renders the visible window) if you tried to search with css the cells that are now blue, you'll have a bad time. Instead you can use the object it spits back which has all the matched rows.
From here out to hide the non-matched rows, it gets tough. What I did was write a simple function that physically changes the
data
array so that the matched rows go to the top, and then I hide the rest. This way the scrolling works fine.Hope that works!
For me, their is two cases for a live filtering with Handsontable. A columns filters, and/or search filter.
1. Individual Column Filter
One filed per column allowing to apply multiple filter at the same time :
Find the working example in this JS Fiddle
2. Search Filter
A field allowing to search any value anywhere in the table :
Find the working example in this JS Fiddle
In both case, if the data are destined to be modified, the integrity of the original data must be kept every time a filter is applied. You can refer to the two first links for more details of the two cases.
Note that both function can be merged and be used at the same time.