Using Editor's "joined" attributes as part of the filters on the DataTables object

Using Editor's "joined" attributes as part of the filters on the DataTables object

agustin_garciaromeroagustin_garciaromero Posts: 42Questions: 0Answers: 0
edited March 2013 in Editor
Hello,

I have the following JSON object from an Editor's join:
[code]
DT_RowId: "row_1"
customer: "10"
release_id: "4"
project_name: "Project 1"
project_manager: Object { id="6", name="First, Last"}
[/code]
In my screen, I'd have two select buttons used to filter by "release_id" ('projects' table) and by "users.id" (join attribute, based on project's id and manager's id (located in 'project_pm' joining table)
The first filter is plainly applied, being the 'release_id' a 'native' attribute in the DataTables object, e.g.: dtObj.fnFilter(release_id, 0, true);

How do I 'set' the users.id as part of the DataTables attributes to be able to apply filters on it as well? Or,
How can I use dtObj.fnFilter to reach down to project_manager.id attribute?

Hope I'm making my self clear, if required I can share the associated files.
Thanks in advance

Replies

  • agustin_garciaromeroagustin_garciaromero Posts: 42Questions: 0Answers: 0
    Hello,
    Any feedback on this one? Any place to start with?

    Regards
  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    Filtering in DataTables currently occurs only on the data in the columns. If project_manager.id is in a column, then you can use fnFilter to filter on it.

    If it isn't in a column, then you would need to use a custom filter, as described here: http://datatables.net/development/filtering#row_filters .

    Allan
  • agustin_garciaromeroagustin_garciaromero Posts: 42Questions: 0Answers: 0
    Thanks, I was able to apply the filter based on this plugin
This discussion has been closed.