yadcf and cumulative_filtering?

yadcf and cumulative_filtering?

Dalex73Dalex73 Posts: 30Questions: 4Answers: 4

Playing around the cumulative_filtering: true since I want the filter dropdowns to be populated with the filtered data and that seems to work just fine BUT I do not want it used at the inital draw of the table. So for instance if I have 111 unique rows of data I want to have the dropdown contain all 111 entries and not just 50 if the page length is set to that. So basicly I would like to toggle cumulative_filtering from false after the initial draw to true and then keep it like that.

This question has an accepted answers - jump to answer

Answers

  • Dalex73Dalex73 Posts: 30Questions: 4Answers: 4

    Anyone have any idea how to solve this, @daniel_r maybe?

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,771

    Maybe I'm misunderstanding your problem description but if I try the yadcf cumulative_filtering example it seems to load all options on initial load. If this is behaving as you are wanting but your code is not maybe you can provide and example of what's not working.

    Kevin

  • Dalex73Dalex73 Posts: 30Questions: 4Answers: 4

    From what I can see it just fills the filters with the rows currently displayed on the page, so if you have a page length of 50 rows and paging for say 3 pages the filters will just include the first 50 rows and not the rest.

    So it's not possible to find a row value from say the last page. This of course works if you set it to false then all rows populated in the filter dropdown but then of course they will stay populated with all these rows even if the table is filtered down to say 5 rows.

    You get what I'm looking for now if even possible?

  • kthorngrenkthorngren Posts: 20,309Questions: 26Answers: 4,771
    Answer ✓

    In the example there are two pages and I see it populating data from both pages on initial search. For example the first column has "Some Data 1", "Some Data 2", "Some Data 3" and page 2 has "Some Data 4", "Some Data 5", "Some Data 11". When I click on the search input I see all of those options.

    Is that what you are seeing and what you are looking for?

    Wait, maybe you are using server side processing?

    Kevin

  • Dalex73Dalex73 Posts: 30Questions: 4Answers: 4

    Thanks, no I'm not using serverside but ajax loading. I will have another look at a bit later today as the example seem to do the correct thing but not my code as far as I can tell.

  • Dalex73Dalex73 Posts: 30Questions: 4Answers: 4

    Ok I have done some more testing and researching now and the issue is with the deferRender: true. When set to true then the filter only gets populated with what is visible and if set to false it takes the data from all pages.

This discussion has been closed.