Changing from 1.5.6 to 1.7.3 causing issues
Changing from 1.5.6 to 1.7.3 causing issues
I am working on an old project which was using an older version of DataTables.
I was trying to get a few filtering bits working so decided to upgrade to the latest version however this has caused a few more issues!
this is my filtering code:
[code]
$('#filter').keyup(function() {
oTable.fnFilter( $(this).val(), 1 );
$('#player_table_wrapper').jScrollPane();
});
[/code]
works fine in 1.5.6 but does nothing in 1.7.3! The issues I was having in 1.5.6 was trying to do a reverse filter using Regex as I have seen suggested on this forum before, that wouldn't work in 1.5.6 at all!
Another issue, although not the end of the work in 1.7.3 when ever i use:
[code]
oTable.fnSetColumnVis( i, false );
[/code]
My Web Development Toolbar throws up the following issues:
[code]
Warning: Selector expected.
Source File: http://localhost/drafts
Line: 0
[/code]
Anyone know why the filtering wouldn't be working in the latest version, pulling my hair out here - and I don't have a lot of it left! :)
Thanks
I was trying to get a few filtering bits working so decided to upgrade to the latest version however this has caused a few more issues!
this is my filtering code:
[code]
$('#filter').keyup(function() {
oTable.fnFilter( $(this).val(), 1 );
$('#player_table_wrapper').jScrollPane();
});
[/code]
works fine in 1.5.6 but does nothing in 1.7.3! The issues I was having in 1.5.6 was trying to do a reverse filter using Regex as I have seen suggested on this forum before, that wouldn't work in 1.5.6 at all!
Another issue, although not the end of the work in 1.7.3 when ever i use:
[code]
oTable.fnSetColumnVis( i, false );
[/code]
My Web Development Toolbar throws up the following issues:
[code]
Warning: Selector expected.
Source File: http://localhost/drafts
Line: 0
[/code]
Anyone know why the filtering wouldn't be working in the latest version, pulling my hair out here - and I don't have a lot of it left! :)
Thanks
This discussion has been closed.
Replies
However, the call you've got to fnFilter above most certainly should work! As can be seen in this example, http://datatables.net/examples/api/multi_filter.html the call I've got is the same (string, int) and that is okay. Could you post a link to your page which doesn't work please?
Likewise with the fnSetColumnVis - I've not seen that error before, so if you could give us a link to see this in action, that would make debugging much easier.
Thanks,
Allan
http://www.mikej.co.uk/test.htm
Still getting the same errors, I'll keep digging to see if I can find what the issue is (its probably something simple)!
The fnSetColumnVis seems to me works okay for me in the example you've put up there. Could you confirm what browser / platform you are using?
Allan
In regards to the issue with fnSetColumnVis, its not an issue in that it stops JS from firing, it works and does hide the column correctly. Its just an warning that appears in the Error Console when using the Web Developer Toolbal on Firefox.
I'm running FF 3.6.10
Thanks again!
If I wanted to only filter a specific part of a cell is that possible?
For example my cells have data in as follows
Player (position - team)
I only want to filter on the player name and ignore the position/team. Is it possible to specific HTML tags to search within? Or would I need to do it in RegEx?
Cheers
If I enter the following in to the text box:
Ash.*\(.*\) it searches fine and works as expected. If I move .*\(.*\) to be added automatically to the search string it doesn't work.
Test up on the same page, two text boxes to demonstrate the problem.