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
Issue with filter widget and UI range / slider #1107
Comments
the problem isn't with TS it's in your JS code
add
before the first split you'll see that n is a unixtimestamp and not a date/time string like you seem to be expecting.
you'll see you can just convert it to a time stamp by simply passing it directly to new Date(); I should have stated the reason. It's because of how textExtraction works on the cells, the parser is seeing it as a date and all date date gets stored internally as a unixtimestamp. here is a working example for you http://jsfiddle.net/f58479re/2/ |
added more explanation and a working example. |
Hello, |
I'm going to look deeper into it on the site there is a proposed change to the function params I wonder it that change has started early, I'll talk to @Mottie about it Sent from my iPhone
|
The reason you're seeing a change from v1.16.5 is because the time parser now extracts out the time in case you manually set the time parser on a full date column like "12/18/2015 6:30 PM" - it will now only target the "6:30 PM" So, if you look at the // function variables:
// e = exact text from cell
// n = normalized value returned by the column parser
// f = search filter input value
// i = column index
// $r = jQuery element of current row
// c = table.config
// data = combined filter data
0: function( e, n, f, i, $r ) { ... } You will see that To get exact table cell content, use I updated your demo, and added a "sorter-text" class to the header cell.... but I'm not sure what the slider is supposed to do. I can slide it all the way across and it doesn't do anything. What were you wanting that range slider to do? |
Ok, I fixed the time detection regex. |
It needs the filtered class added, and when I checked n and e where the same Sent from my iPhone
|
Hello, Here my scenario: the column contains hour time slot, for instance 08:00,12:00 and 10:00,14:00. By using the slider, I want to filter all lines which contain for instance 12:00,14:00 (12-14 with the slider). Maybe there is a better way to do it... Regards, |
That is odd, the Alternatively, you can use the other parameters like this: 0: function( e, n, f, index, $row ) {
var txt = $row.children().eq(index).text();
// process txt & return boolean
} or if you are using the latest filter widget, a 0: function( e, n, f, i, $r, c, data ) {
var txt = data.$cells.eq(data.index).text();
// process txt & return boolean
} I tried updating your demo, but it isn't working... I think it's the comparison logic in the |
I agree my tests showed the parser value for e and n. Hence my comment that maybe the planned changes had already accidentally started, my computer was tied up all weekend so I didn't have a chance to check on it either. and as you can see in my jsfiddle I kinda did the same as @Mottie, I just didn't use children(), cause @Mottie is better then me ;) |
Hello,
I've tried to upgrade tablesorter from 1.16.5 to 1.19.3 (and now 1.20.0) and a problem occurs with a filter function using a jquery UI slider. Here the jsfiddle:
http://jsfiddle.net/f58479re/1/
Try to use slide, an error will occurs : n.split is not a function
Before, I got "05:00,08:00" in
n
parameter fromfilter_functions
. Now I get an Integer... 946699200000 Seems to have a problem with "parsed" fields.Thanks for your support,
Fabien
The text was updated successfully, but these errors were encountered: