Results 1 to 3 of 3

Thread: Reload external script file

  1. #1
    Sencha User
    Join Date
    Nov 2015
    Location
    Romania,Timisoara
    Posts
    14
    Answers
    2

    Default Reload external script file

    Hello, sorry for putting this question but i'm a little newbie in extjs. Do you know if is possible to reload an external script file, and if it is, how to do it? (with ext.loader maybe?) Thank you!

  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    You can certainly load in a script file using Ext.Loader. I'm not sure what you mean by reloading one though. What is your intent?
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  3. #3
    Sencha User
    Join Date
    Nov 2015
    Location
    Romania,Timisoara
    Posts
    14
    Answers
    2

    Default

    So, i have a file in which i have a config object, and in this config i have a property called build. Each time a new deployment has been made on the server i need to know that, so that i can ask the user if he wants to refresh the website because a new build was made. The deployment script takes care of tgis build number in my js file. So , right now, i'm doing this with a task runner and with jq, but i'm sure it can be done differently. Thank you.
    That's what i'm using now:
    PHP Code:
    checkConfigFile: function() {
    var 
    id "configFileId";
    var 
    $el =  $('#' id);
    $(
    '#' id).replaceWith('<script id="' id '" src="' $el.prop('src') + '"><\/script>'); 
    if(
    globalConfigObject.build!==Mvp.util.Config.getBuild() || globalConfigObject.version!==Mvp.util.Config.getVersion()){        Ext.MessageBox.show({     titletranslate('Warning'),                
    msgtranslate('global.msg.software_update_available') + '<br><i>' translate('Current Version') + ': <b>'+Mvp.util.Config.getVersion() + '-' Mvp.util.Config.getBuild() + '</b></i><br><i>' translate('New Version') + ': <b> 'globalConfigObject.version '-' globalConfigObject.build '</b></i>',
    minHeight:200,
    minWidth:400,
    closablefalse,
     
    iconExt.MessageBox.WARNING,
    buttonsExt.MessageBox.YESNO,
    fn: function(btn){
    if(
    btn === 'yes') {
    Mvp.util.Util.ReloadMVP();}}});}} 

Similar Threads

  1. How to include External script in UMD format
    By Psychokrameur in forum Sencha Cmd
    Replies: 1
    Last Post: 26 Jan 2016, 10:25 AM
  2. Load external script within Ext JS 4
    By kayasa in forum Ext: Q&A
    Replies: 2
    Last Post: 23 Apr 2015, 11:20 AM
  3. referencing external Java Script File in Ext JS from markup grid
    By SamruddhiPravin in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 5 Feb 2009, 1:24 AM
  4. Replies: 6
    Last Post: 7 May 2008, 10:31 PM
  5. How to get external script with extjs
    By psscommusic in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 6 May 2008, 5:34 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •