Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter Data with bVisible=false #16

Closed
joedoe6781 opened this issue Nov 30, 2013 · 5 comments
Closed

filter Data with bVisible=false #16

joedoe6781 opened this issue Nov 30, 2013 · 5 comments

Comments

@joedoe6781
Copy link

Filter works fine if you have only "Datatables" bVisible=true columns.
If there are bVisible=false columns included the datasource shown in Filter will be not from the column where the filter element is located.

Example:
var userTable=$('#myDataTables').dataTable({
/* Spalte0 / { "bSearchable": false,
"bVisible": false },
/
Spalte1 / { "bSearchable": false,
"bVisible": false },
/
Spalte2 / null,
/
Spalte3 / null,
/
Spalte4 / null,
/
Spalte5 / null,
/
Spalte6 / null,
/
Spalte7 */ null
]
}).yadcf([
{column_number : 0}, // shows filter in "Spalte2" and uses datasource for filter from "Spalte0"
{column_number : 2} // shows filter in "Spalte4" and uses datasource for filter from "Spalte2"
]) ;

How can a show the datasource from it's own column ?

@vedmack
Copy link
Owner

vedmack commented Nov 30, 2013

Haven't tried my plugin with bVisible=false, will check it out...

@vedmack
Copy link
Owner

vedmack commented Dec 1, 2013

Looks a bit tricky, will take some time... so let me know if you still interested, eventually you will have to use {column_number : 2} if you want to use and filter the Spalte2 column (it will place the filter in the Spalte2 column.

@joedoe6781
Copy link
Author

many thanks for an answer.
Surely i am interested in a solution. I haven't found a more powerful PlugIn for filtering in datatables as yours.
Unfortunately i am far away to understand your code to help myself.

Your suggestion will run into problems when you like to add a filter for the last column if you have "bVisible=false" columns.

@vedmack
Copy link
Owner

vedmack commented Dec 1, 2013

If for example you want to display the filter for Spalte6 you will use {column_number : 6} , and if you will use "bVisible=false" on Spalte7 , there will be no point in calling {column_number : 7} or in general there is no point in calling {column_number : XXX} where XXX refers to a "bVisible=false" column (unless the filter going to be located in external container)

@vedmack
Copy link
Owner

vedmack commented Dec 1, 2013

Done and added to 0.4.6, grab it from master : https://github.com/vedmack/yadcf/blob/master/jquery.dataTables.yadcf.js or from https://github.com/vedmack/yadcf/releases/tag/0.4.6

In your specific example, if you want to show filter for Splate2 column use {column_number : 2} , in general the column number should refer to the relevant column in datatables (bVisible=false still counts a column)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants