0

I am working with javafx and need to implement filters for my tablecolumns.

What I need is functionality to right click on column header and add a filter. I know I can have contextmenu added to my header which will be displayed when I right click my header but I don know how to open a new window (as in swing JFrame) create a filter according to datatype in column and filter data when filter is applied (auto closing this new window).

learner
  • 1,952
  • 7
  • 33
  • 62
  • there (never tried) must be [Comparator for Table View](http://docs.oracle.com/javafx/2/ui_controls/table-view.htm) a few times saw on this forum – mKorbel Jun 26 '13 at 06:05
  • @mKorbel my question is not about comparator I can write my own comparator but I need that right click part mainly. – learner Jun 26 '13 at 06:38
  • but I need that right lick part mainly. – [for example](https://code.google.com/p/javafx-filterable-table-columns/) – mKorbel Jun 26 '13 at 06:41
  • already tried it but its not what I want, onclick it will open filter selection as shown... I need a new window where I can select my filter click ok and then it will do filtering in my main window – learner Jun 26 '13 at 06:44
  • 1
    I have do something like this. I have a tableView with some data, when I right click on the top a textfield apear and I can filter my data with a regex. and it's dynamicaly refresh. To do this I filter my stuff on my observableList and aplly my new ObservableList to the listView each time the filter is changed. – agonist_ Jun 26 '13 at 07:07
  • @agonist_ can you give example in a code – learner Jun 26 '13 at 07:13
  • Panemu's [TwiulFX](http://tiwulfx.panemu.com/demo/) allows context menus to be used to set filters on columns. – jewelsea Jun 26 '13 at 07:46
  • @jewelsea I had one other question can you answer it here rather than me asking new question Thanks am also trying to implement deleting elements(rows) from my table I am using table.getItems().remove(index); but it is slow is there ny other way which is fatser – learner Jun 26 '13 at 08:28
  • @jewelsea can same thing be replicated for tableheader am unable to do so... – learner Jun 26 '13 at 08:42

0 Answers0