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

Since last update, header inputs no longer accessible... #911

Closed
Francks11 opened this issue May 18, 2015 · 16 comments
Closed

Since last update, header inputs no longer accessible... #911

Francks11 opened this issue May 18, 2015 · 16 comments
Labels

Comments

@Francks11
Copy link

Hello @Mottie,

since last update, header inputs are no longer accessible.

You can see this here : http://jsfiddle.net/Francks11/oqfq47fc/1/

Why?

Thanks

@Mottie
Copy link
Owner

Mottie commented May 18, 2015

Hi @Francks11!

It's because of this line:

// needed or jQuery v1.2.6 throws an error
e.preventDefault();

I'm not sure why, but if I comment out that prevent default, jQuery v1.2.6 will throw an "Uncaught TypeError: handler.apply is not a function".

Maybe it's time to drop support for 1.2.6?

@Francks11
Copy link
Author

Hi @Mottie,

I use currently version v1.7.2 of jQuery...

Thanks

@Mottie
Copy link
Owner

Mottie commented May 18, 2015

Yes, but tablesorter supports jQuery v1.2.6, so I need to find a work around or remove support for that really old version.

@Francks11
Copy link
Author

jQuery 1.2.6 is out May 24, 2008. 7 years...

Indeed, it is time to drop support if that is not possible otherwise. :-p

@Mottie
Copy link
Owner

Mottie commented May 18, 2015

Does that table even sort?... if I right-click in the input, I can get focus to it, and yes, I know that isn't ideal.

@Francks11
Copy link
Author

For this case, I do not use sorting because the data must appear in a specific order.

But I use scroller widget for fixed header and fixed columns...

Its not very practical with the right click :-)

@Francks11
Copy link
Author

Why have you the need to add this code e.preventDefault(); from this version?

@Mottie Mottie closed this as completed in 4410ece May 18, 2015
@Mottie
Copy link
Owner

Mottie commented May 18, 2015

Umm, because there was an error in jQuery v1.2.6?

It should work now... the update is in the master branch.

@Mottie
Copy link
Owner

Mottie commented May 18, 2015

Here is your demo using the core from the master branch.

@Francks11
Copy link
Author

okay thanks for your reactivity. :-)

@Francks11
Copy link
Author

I encounter a other issue with header input fields...

It is no longer possible to select the text in the field with mouse with Internet Explorer, for example, to replace text.

@Mottie
Copy link
Owner

Mottie commented May 18, 2015

Set the cancelSelection option to false (demo).

@Francks11
Copy link
Author

Thanks :-), a lot of options unknow.

@Francks11
Copy link
Author

Hi @Mottie, @TheSin- ,

I suggest you a improvement of cancelSelection, do not apply on input in header columns.

Use case :

I don't want that the header text can be select, but I would like that the text can be select on input.

I have see this code in tablesorter, which cancel select :

                if (c.cancelSelection) {
                    // cancel selection
                    $headers
                        .attr('unselectable', 'on')
                        .bind('selectstart', false)
                        .css({
                            'user-select': 'none',
                            'MozUserSelect': 'none' // not needed for jQuery 1.8+
                        });
                }

Thanks. :-)

@Mottie
Copy link
Owner

Mottie commented May 20, 2015

The cancel selection is applied to the header cell, not the inputs.

Since you have a extra rows in the header that are not used for sorting, you can use the same method the filter widget uses by adding "tablesorter-ignoreRow" (set by cssIgnoreRow option) to rows that you don't want to be included with config.$headers (demo). The header cells within that variable will be targetted by the cancelSelection code above.

<tr class="tablesorter-ignoreRow">
    ...
</tr>

I'll update the docs to emphasize this fact.

@Francks11
Copy link
Author

Thanks :-)

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