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

stickyHeader filter value issue #317

Closed
TheSin- opened this issue May 27, 2013 · 18 comments
Closed

stickyHeader filter value issue #317

TheSin- opened this issue May 27, 2013 · 18 comments
Labels

Comments

@TheSin-
Copy link
Collaborator

TheSin- commented May 27, 2013

I know for this one you will need to see the code but that is going to be very difficult for me to provide seeing how complex this site is and the fact that i have a custom tableSorter widget. I might have to try and build a static version of it to post.

That being said I'm having a very odd issue with default filter values and it changing cols in sticky headers.

This is my filters at the top.

screen shot 2013-05-27 at 9 52 08 am

and here it is with sticky headers, notice the numeric col jumped over, the 0 is now in a text field. it's very odd and I can't seem to figure out why it's happening.

screen shot 2013-05-27 at 9 52 18 am

Any idea Rob? Before I take a day to make a demo version?

Sorry about the blur but it's an internal site and my company is pretty strict with privacy of it. Basically it's just the last 2 filters we are looking at in the blur ;)

@TheSin-
Copy link
Collaborator Author

TheSin- commented May 27, 2013

This MIGHT be related to #307 I just updated today and forgot not all my changes got into 2.10.3. Let me add that change back into my copy and see if it helps. Though honestly I'm grasping at straws now ;)

@TheSin-
Copy link
Collaborator Author

TheSin- commented May 27, 2013

nope not related to #307, still seeing if I can figure it out.

@Mottie
Copy link
Owner

Mottie commented May 27, 2013

I'm not sure if you are adding a filter input into the sticky header, but if you are make sure it has a class name of tablesorter-filter and a data attribute indicating the correct column number: data-column="1"

@TheSin-
Copy link
Collaborator Author

TheSin- commented May 27, 2013

htmlNumber is using a hidden and input maybe it has to do with that?

<td style="width: 76px; height: 28px; ">
<input type="hidden" value="&gt;=30" placeholder="" class="tablesorter-filter" data-column="10">
<input class="number" type="number" min="0" max="1000000" value="30" step="1">
</td>
<td style="width: 128px; height: 28px; ">
<input type="search" placeholder="" class="tablesorter-filter" data-column="11">
</td>

@TheSin-
Copy link
Collaborator Author

TheSin- commented May 27, 2013

looks like I'm on the right track with your comment except I'm not adding the input the htmlNumber filter is doing it. I'll look deeper into that section and see if I can figure out it's missing the class and data-column

@TheSin-
Copy link
Collaborator Author

TheSin- commented May 27, 2013

BTW this is all I'm using to make that col

                        widgetOptions: {
                                filter_formatter: {
                                        " . $agecol . ": function(\$cell, indx) {
                                                return $.tablesorter.filterFormatter.html5Number(\$cell, indx, {
                                                        value: " . $daysold . ",
                                                        min: " . $mindays . ",
                                                        max: " . $maxdays . ",
                                                        delay: true,
                                                        addToggle: false,
                                                        exactMatch: true,
                                                        skipTest: true,
                                                        compare: '>='
                                                });
                                        }
                                }
                        }

so nothing being injected and I never modify the stickyHeaders at all.

@Mottie
Copy link
Owner

Mottie commented May 27, 2013

What is that backslash doing in there? (\$cell... I think that might have been in the last version =/

@TheSin-
Copy link
Collaborator Author

TheSin- commented May 27, 2013

php code, have to escape the $ so that it makes it into the js, I should have cut and pasted the output rather then the source sorry about that.

The odd part is that in the code it's working right both the normal and sticky version of the hidden field are updating when I change it, but it's displaying in teh wrong field, it's very very odd. Maybe a Safari only issue I'm going to test with FF one sec.

@Mottie
Copy link
Owner

Mottie commented May 27, 2013

Ahh ok that makes sense... well check table.config.$filters and see if it contains all of the filter cells (td's in order).

@TheSin-
Copy link
Collaborator Author

TheSin- commented May 27, 2013

Okay FF is worst

Safari take the value and moves it to the next field
FF Takes the value and moves it to the next field but in the Number field show the hidden value of >=30

:\

okay one sec I need to make an alert to see it in js, I miss firebug on safari not going to lie ;)

@TheSin-
Copy link
Collaborator Author

TheSin- commented May 27, 2013

looks like it's a bug, easy demo to show it

http://jsfiddle.net/abkNM/830/

hope that helps, if you want me to try anything else just let me know I think it's beyond my talents and knowledge of tablesorter without spending too much time on it.

@Mottie
Copy link
Owner

Mottie commented May 27, 2013

Chrome's developer tools are so much better.

Hmm, sorry, I guess I'm having an "off" day... I still haven't had a chance to work on fixing the filter_formatter scripts to work properly with the sticky headers widget. The main problem is that the sticky headers widget is initialized after the filter widget, so the filter_formatter doesn't have the sticky header in place to update. And the sticky header widget isn't a good place to add more code for each individual filter_formatter type.

If we initialize the sticky header widget first, then it won't know the filter widget and would take some rewriting to make it work properly. Either way, one or both of the widgets will need to be modified.

@TheSin-
Copy link
Collaborator Author

TheSin- commented May 27, 2013

ahh okay so this is just an extension of that bug. Okay that makes sense, when I updated to 2.10.3 the filters in stickyHeaders started working for me so I was excited and thought it was fixed. As the very least I hope this example helps, in the mean time i'll just hide them on my site again, maybe I'll dig deeper some day and actually try and help with this one ;) but for now it's a monday and that means monday type things are happening ;)

@Mottie
Copy link
Owner

Mottie commented May 30, 2013

Alright, I just updated to version 2.10.5 with the filter formatter working within sticky headers! :)

@TheSin-
Copy link
Collaborator Author

TheSin- commented May 30, 2013

sadly 2.10.6 does NOT fix this issue

in safari I have the right value in the html5Number field, but the next one get the >=0 and updating the >=0 version in the wrong field does re filter but does not update the none sticky version.

just about to test in FF I'll report back.

@Mottie
Copy link
Owner

Mottie commented May 30, 2013

Try updating the jquery.tablesorter.widgets.js file.

@TheSin-
Copy link
Collaborator Author

TheSin- commented May 30, 2013

I thought I removed my cache one sec I'll make extra sure.

EDIT: damn it you are right it didn't clear, okay it is confirmed it work in both FF and safari ticket closed ;)

@TheSin-
Copy link
Collaborator Author

TheSin- commented Jun 3, 2013

This issue is closed with 2.10.5/6

@TheSin- TheSin- closed this as completed Jun 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants