jQuery UI Widgets Forums General Discussions RequireJS Support?

This topic contains 4 replies, has 4 voices, and was last updated by  wavetrex 11 years, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • RequireJS Support? #19093

    lostobject
    Member

    Has anyone been able to get jqwidgets loaded correctly using RequireJS? In particular I am trying to load jqxcore.js, jqxgrid.js and jqxknockout.js. I have specified the dependencies of each using a shim configuration in my require.config but it does not seem to work. For example, the jqwidget knockout binding handlers are not added to the ko object.

    RequireJS Support? #20798

    arajput
    Member

    Hi wondering if you found a solution to this problem? I am having the same issue.

    RequireJS Support? #20804

    Peter Stoev
    Keymaster

    Hi guys,

    jqxKnockout requires Knockout Framework to be already loaded because jqxKnockout plug-in extends the Knockout Framework’s custom bindings. I suppose that is the issue on your side.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    RequireJS Support? #20835

    arajput
    Member

    Hi Peter,
    Actually I am not using knockout, but backbone and marionette. In my view’s onRender method when I try to render the jqxgrid, is when I am having issue loading jqx libraries through require js.
    Is there a recommended approach for loading through requirejs?

    Thanks
    Ashish

    RequireJS Support? #21052

    wavetrex
    Participant

    I don’t know if RequireJS has controllable order of execution for async loaded scripts… however, I can tell you how I did it with LABjs:

    “self.config.jqwidgets” contains the names of the modules which need to be loaded, as an array in proper order
    “LABjs” is the loader instance

    LABjs.setGlobalDefaults({
    AlwaysPreserveOrder: true
    });
    LABjs.queueScript("/jqwidgets/jqxcore.js");
    for(c = 0; c< self.config.jqwidgets.length; c++)
    LABjs.queueScript("/jqwidgets/jqx"+self.config.jqwidgets[c]+".js");
    LABjs.queueWait(function() {
    // ... do widgets initialization here
    });
    LABjs.runQueue();

    Hope this helps and you find a similar solution for RequireJS !

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.