Closed mitrakov closed 4 years ago
Are you using a MVP framework like GWTP? There seems to be an unresolved issue where the entrypoint is loading before GMD is able to load the javascript library. You can confirm this by manually loading JQuery in the index.html
and using <inherits name="gwt.material.design.GwtMaterialDesignBasic"/>
Yep, you're absolutely right. I use out-of-the-box GWTP with MvpWithEntryPoint
.
Your workaround works. With jQuery 2.2.4. Thanks!
Is this idiomatic solution? What do you think should I open an issue for GWTP guys?
Ok figure it out whats causing it, it seems that on constructors when adding it on GWTP UiBinder it seems that jquery is not loaded. So we need to check on MaterialWidget constructor if Jquery is loaded if not then we need to inject it. Fixed via https://github.com/GwtMaterialDesign/gwt-material/commit/28d1300a08fb03ebb60df76bdef277995ded505b
We are reworking also the GMD Table demo for the latest Updates and documentation.
Also Dark Mode will be implemented to GMD DataTable too. Currently the Core supports Dark Mode https://gwtmaterialdesign.github.io/gmd-core-demo/
@mitrakov I would say its subjective to your implementation, personally I would prefer loading JQuery myself, but also our JQuery jsinterop only supports v~2. Will try to figure out a solution to this issue when I have time.
Edit: no real need to open a GWTP issue just yet, I'll need to figure out why its happening first I think.
Yes, I noticed that jQuery 2.2.4 is the last version that works properly 🙂
Anyway, thank you guys, @BenDol , @kevzlou7979, I hope your patch with .checkJQuery(false)
will really help!
As for now manual loading jQuery in html does the trick
I have a standard GWT MaterialDesign project with a MaterialDataTable When I try to reload page with a single simple MaterialDataTable in superdev mode it throws:
But when I navigate to it, it works normally!
Looks like jQuery module is too late to load to get MaterialDataTable started.
The exception is caught in Eventbus:
I have all the required dependencies installed:
How to reproduce: 1) install basic app:
2) Add nested slot to ApplicationPresenter (SLOT_MAIN) 3) Add a standard presenter module that uses Place "table":
4) Add MaterialDataTable to a view:
That's it. Run superdev mode.
P.S. also reproducible on 2.2