-
Notifications
You must be signed in to change notification settings - Fork 729
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
Removeal of jQuery - how to bind grid? #2023
Comments
(I know you still need jQuery etc now, we don't use jQuery anywhere else and would like to use this "directly" not as a jQuery plugin) |
After evaluating the removal, it appears that it would not be as easy, nor do I think will bring much benefit. JQuery is a quality lib and it is very actively supported. Respect to jQuery team. At least query selector part of it (sizzle) is more advanced than css selectors). However, the effort is made to make w2ui ES6 native. Work is being done in this regard quite a bit. Here is by the way an example how ES6 native w2ui will look like es6 example so it would look similar what you mentioned, import '../libs/jquery/jquery-3.5.1.js'
import { w2grid } from 'w2ui.js'
import conf_grid from './conf-grid.js'
let grid = new w2grid(conf_grid)
grid.render(document.querySelectAll('#div')) And yes, it is possible now. Just call |
For 1.5.x version, here is a starter project that shows how to use it with ES6 modules w2ui-srater |
Ok will try your querySelectorAll example, I assume that's what you meant. I tried with the actual node I guess you're saying render() needs a nodelist and not a node/element. Will try that out next week. Thank you for the information. |
It needs a node, not list, my bad. Please modify the code |
Removing jQuery is a bad decision that has in my opinion no reason. Better decoupling ui and data sources would be a good thing. |
@LucaGabi removing JQuery is something that has been requested by some users over the past few years. But that does not mean it will happen anytime soon. As Vitali already pointed out, it would be a huge task with very little benefit. |
Describe the problem your feature will solve.
I like that you are talking about removing jQuery. Great.
How do you bind to a dom node? Is this possible now?
$('#myGrid').w2grid({}) - replace this with what?
tried
const grid = new w2grid({});
const node = document.querySelector("#myGrid");
grid.render(node);
and a few other variants.
no dice.
The text was updated successfully, but these errors were encountered: