1. #11
    Sencha Premium Member
    Join Date
    Jun 2013
    Location
    Boulder, CO
    Posts
    538
    Vote Rating
    7
    DavidThi808 is on a distinguished road

      0  

    Default


    Hi;

    No problem creating a duplicate if you can point me at how to do that. Do I create another store object, then call Apply() to copy all settings across, then set the url specifically as that will be different?

    And when/where do I set this duplicated store as the store for the created window? Can I do that after I instantiate the window? And if so, must I turn autoload off and then explicitly call load? Or can I set it before the autoload triggers?

    thanks - dave

  2. #12
    Sencha Premium Member
    Join Date
    Jun 2013
    Location
    Boulder, CO
    Posts
    538
    Vote Rating
    7
    DavidThi808 is on a distinguished road

      0  

    Default


    Asking again. How can we pass values to a window when we create it using Ext.widget()? The Window is created in Architect.

    We need several variables and these are used for multiple things, some for URLs to load data, some for values passing to the business logic.

    ??? - thanks - dave

  3. #13
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Location
    Stockholm, Sweden
    Posts
    550
    Vote Rating
    50
    tangix is a jewel in the rough tangix is a jewel in the rough tangix is a jewel in the rough

      0  

    Default


    I don't know if I understand you question correctly, but if you are asking how to pass additional parameters to a Window you created in SA I'll try to give you an answer. I am not sure what your issues are with SA as this is pure Ext JS stuff, passing config objects to the component when it is instansiated.

    I have a base Window created in my project that I'd like to set different titles on. I created the Window in SA and added a process config setting the title to the passed parameter "windowtitle" and load the appropriate help page from the backend using the helpScope parameter.

    The complete code for this in SA is:
    Code:
    Ext.define('VPCalcDesktop.view.HelpWindow', {
        extend: 'Ext.window.Window',
        alias: 'widget.helpwindow',
    
        height: 600,
        width: 550,
        overflowY: 'auto',
        bodyPadding: 15,
        title: 'My Window',
        modal: true,
    
        initComponent: function() {
            var me = this;
    
            Ext.applyIf(me, {
                loader: {
                    
                },
                header: {
                    titleAlign: 'center'
                },
                listeners: {
                    show: {
                        fn: me.onWindowShow,
                        scope: me
                    }
                }
            });
    
            me.processHelpWindow(me);
            me.callParent(arguments);
        },
    
        processHelpWindow: function(config) {
            config.title = this.windowtitle;
            return config;
        },
    
        onWindowShow: function(component, eOpts) {
            component.getLoader().load({
                url: VPCalcDesktop.config.backend + 'help/index/' + this.helpScope + '/se',
                loadMask: true,
                autoLoad: true
            });
        }
    
    });
    I then call this from my event handlers with the following code:
    Code:
    var w = Ext.create('widget.helpwindow', { helpScope: target.help_tag, windowtitle: VPCalcLang.help_title, animateTarget: target });
    w.show();
    /Mattias

  4. #14
    Sencha Premium Member
    Join Date
    Jun 2013
    Location
    Boulder, CO
    Posts
    538
    Vote Rating
    7
    DavidThi808 is on a distinguished road

      0  

    Default


    Hi;

    Yes exactly that. However, I want to assign a default value to windowtitle (from your example). Is there a way to do that in Architect?

    thanks - dave

  5. #15
    Ext JS Premium Member tangix's Avatar
    Join Date
    Mar 2010
    Location
    Stockholm, Sweden
    Posts
    550
    Vote Rating
    50
    tangix is a jewel in the rough tangix is a jewel in the rough tangix is a jewel in the rough

      0  

    Default


    See attached archived project created SA 2.2.2.
    The property "a_value" is set in the Config panel on the Window using the "Add" button.
    Attached Files

  6. #16
    Sencha Premium Member
    Join Date
    Jun 2013
    Location
    Boulder, CO
    Posts
    538
    Vote Rating
    7
    DavidThi808 is on a distinguished road

      0  

    Default


    hank you

Thread Participants: 2