Actually the filter starts as soon as you start typing, rather than at 3 characters. Have a look at the example on the home page ( http://datatables.net ) and type a 'z' into the filter. You'll see it match against 'Mozilla' only, with 9 records showing.
Therefore, that suggests that what you are searching for matches some of the text in the table somewhere, for the first two characters.
It doesn't work on my end for some reason.
I have a table with 12 rows: one for each month.
The leftmost column contains the names of all 12 months.
The rest of the columns contain only statistical numeric info.
When I type the letter "F" in the search box, nothing happens - the July row for example is still displayed.
Could you please confirm I understood the usage in the example correctly?
If I have a table with 7 columns, the leftmost one is a string, and the others are numeric, I would initialize like this?
[code]
$(document).ready(function() {
$('#table1').dataTable(
And if I have the next table the same, except the leftmost column is a name of month, it would be initialize like this?
[code]
$(document).ready(function() {
$('#table2').dataTable(
I think you have the basic syntax and idea right - but the usage is probably slightly off. The reason I say this is that DataTables will try to automatically detect date and numeric types. If it can't parse either of then then it falls back to HTML (with a special string type of "html" being provided, to strip HTML out and then sort by string). So you wouldn't need to explicitly say 'date' or 'numeric', and if you did - then it wouldn't work, since it can't be parsed :-)
Do your numeric columns have HTML in them? Is that causing the problem? If so then you would need to use the HTML numeric sorting plug-in: http://datatables.net/plug-ins/sorting#numbers_html and give an sType of 'num-html'. There are also multiple date sorting plug-ins on that page which might help with your date sorting if you are having issues with that as well.
I changed that particular code.
I just strip off html.
The only problem I still have is that if the table cell has "%" following the number, the sorting SOMETIMES gets messed up - percentages of "0.00%" come out as the largest instead of smallest, and percentages greater than 100 come out smallest.
I'm sure you realise, but just for anyone who finds this thread, the % issue is dealt with by my post here: http://datatables.net/forums/comments.php?DiscussionID=1022&page=1#Item_3
Replies
Therefore, that suggests that what you are searching for matches some of the text in the table somewhere, for the first two characters.
Allan
I have a table with 12 rows: one for each month.
The leftmost column contains the names of all 12 months.
The rest of the columns contain only statistical numeric info.
When I type the letter "F" in the search box, nothing happens - the July row for example is still displayed.
Allan
[b]class="leftSide"[/b] or [b]href[/b] from the markup?
You can over rule this default behaviour, as shown here:
http://datatables.net/examples/advanced_init/html_sort.html
Allan
If I have a table with 7 columns, the leftmost one is a string, and the others are numeric, I would initialize like this?
[code]
$(document).ready(function() {
$('#table1').dataTable(
{
"bPaginate": false,
"bInfo": false,
"bSortClasses": true,
"bJQueryUI": true,
"aoColumns": [
null,
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" }
]
}
);
} );
[/code]
And if I have the next table the same, except the leftmost column is a name of month, it would be initialize like this?
[code]
$(document).ready(function() {
$('#table2').dataTable(
{
"bPaginate": false,
"bInfo": false,
"bSortClasses": true,
"bJQueryUI": true,
"aoColumns": [
{ "sType": "date" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" },
{ "sType": "numeric" }
]
}
);
} );
[/code]
I think you have the basic syntax and idea right - but the usage is probably slightly off. The reason I say this is that DataTables will try to automatically detect date and numeric types. If it can't parse either of then then it falls back to HTML (with a special string type of "html" being provided, to strip HTML out and then sort by string). So you wouldn't need to explicitly say 'date' or 'numeric', and if you did - then it wouldn't work, since it can't be parsed :-)
Do your numeric columns have HTML in them? Is that causing the problem? If so then you would need to use the HTML numeric sorting plug-in: http://datatables.net/plug-ins/sorting#numbers_html and give an sType of 'num-html'. There are also multiple date sorting plug-ins on that page which might help with your date sorting if you are having issues with that as well.
Regards,
Allan
I changed that particular code.
I just strip off html.
The only problem I still have is that if the table cell has "%" following the number, the sorting SOMETIMES gets messed up - percentages of "0.00%" come out as the largest instead of smallest, and percentages greater than 100 come out smallest.
I'm sure you realise, but just for anyone who finds this thread, the % issue is dealt with by my post here: http://datatables.net/forums/comments.php?DiscussionID=1022&page=1#Item_3
Regards,
Allan