This topic contains 4 replies, has 0 voices, and was last updated by david.smith 7 years, 3 months ago.

  • Author
    Posts
  • #21595 Score: 0

    savethepennies
    • Contributions: 0
    • Level 1

    Probably like others, we have a script that used jQuery UI. While that has not been officially supported in the past, it also was not officially blocked. Our scripts used jQuery to add script resources to the page like so:

    Code:
    var resources = [
    'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js'
    ];

    for (var i = 0, count = resources.length ; i < count ; i++) {
    jQuery("head").append("<script type='text/javascript' src='"+resources[i]+"' /></script>");
    }
    That allowed us to import libraries needed in the script that weren't already included. Now that jQuery UI is not included by NetSuite it must be imported independently. The method has been working fine for years but now seems to have no effect. This of course causes subsequent calls to fail and that's how I discovered it. Is this no longer possible? Did the 2017.1 release notes leave that out?

    I'm hoping I'm not alone in this and someone has worked around it already.
    This is a cached copy. Click here to see the original post.

  • #21596 Score: 0

    michoel
    • Contributions: 0
    • Level 1

    Have you tried added the file as a library to your Script Record?

  • #21597 Score: 0

    chanarbon
    • Contributions: 0
    • Level 1

    Agreeing with michoel , the general requirement to address this is by having the jqueryUI libraries into the library sublist of the client script. If you are using Suitelets, then it should also be linked to the client script record's libraries sublist.

  • #21598 Score: 0

    savethepennies
    • Contributions: 0
    • Level 1

    I had not tried using library files as I was hoping to use the cdn hosted versions. I'm trying that out now though based on the feedback. Seems to work at least for the jquery ui file so thanks for pointing that out.

    Is there a solution for css files?

  • #21599 Score: 0

    david.smith
    • Contributions: 0
    • Level 1

    I created an HTML file with the links in the file cabinet. Most of the time I use it for the dialog box so I also included the DIV for that.

    Code:
    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script&gt;
    <div id="_dialog" title="Basic dialog"></div>
    Then in my user event before load scripts I just load it to the page in an inlinehtml field. Works great.

    Code:
    var dialogFld = form.addField({
    id : 'custpage_jqueryui_dialog',
    type : serverWidget.FieldType.INLINEHTML,
    label : 'Dialog'
    });
    dialogFld.defaultValue = file.load({id:'SuiteScripts/SWK/jQueryUI_dialog.htm'}).getContents();


    david.smith replied on 06/02/2017, 11:33 AM: NOTE: The above code is SuiteScript 2.0. I just realized this is the SS1 thread.

You must be logged in to reply to this topic.