1. #1
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Pamplona - Spain
    Posts
    21
    Vote Rating
    0
    fmrc is on a distinguished road

      0  

    Default How to reuse classes from projects not created with Architect?

    How to reuse classes from projects not created with Architect?


    I'm trying to build a project based on an example provided by Adrian Kosmaczewski's Sencha Touch 2 Up and Running (https://github.com/akosma/Sencha-Tou.../master/AkoLib), which basically consists of reusing a few classes (model, view and script) by configuring the "paths" property in the Loader. It is pretty simple to add this manually in Sencha Touch projects, but I don't see how to make it work with Architect.

    After setting the configuration of the Loader...
    Code:
    Ext.Loader.setConfig({
        paths: {
            'AkoLib': '../AkoLib'
        }
    });
    ... I want to add a store class where the model is "model: Akolib.model.Item", but the code inserted by Architect modifies it into "model: 'MyAppName.model.AkoLib.model.Item'.

    So,
    - I guess that there is no way of using external paths with Architect - am I right?
    - Should I create the classes within the project and overwrite them with Akolbib's code?
    - Any other way for doing it without too much trouble?

    Thanks in advance,
    Fernando
    Last edited by fmrc; 30 Mar 2013 at 9:43 AM. Reason: html tags in view

  2. #2
    Sencha - Architect Dev Team
    Join Date
    Jul 2012
    Posts
    270
    Vote Rating
    26
    honestbleeps will become famous soon enough honestbleeps will become famous soon enough

      0  

    Default


    Fernando,

    Thanks for posting - I believe I can help you here. We've made this process a little bit easier in Sencha Architect 2.2 with the createAlias function.

    Our documentation on using this is here (bottom of page):

    http://docs.sencha.com/architect/2/#.../collaboration

    However, I find it's always easier to see an example in action. You can see that function in action in our Kiva example here:

    https://github.com/SenchaArchitect/Kiva --- you can just download the XDA file and run it in architect.

    You'll see that there's an external script added, called KivaProxy.js - which was written separately from Architect. In Architect it's added as a resource and then createAlias is used to give it a name by which it can be accessed in your code in Architect.

    I hope that sets you on the right track!

    Steve
    Steve Sobel
    @honestbleeps
    Sencha Architect Development Team

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Pamplona - Spain
    Posts
    21
    Vote Rating
    0
    fmrc is on a distinguished road

      0  

    Default createAlias with models and viewsI

    createAlias with models and viewsI


    Thank you very much, Steve. I'm a newbie with Sencha, totally foreign to Architect.
    The example you refer to adds a JSONP to a store and creates an alias to include the proxy. But I don't grasp how to do the same with models and views. As far as I can see,
    • I can define a CONTAINER for the view and add another CONTAINER into it where I create an alias
    Code:
    Ext.define('MyAppName.view.Akolib', {
        extend: 'Ext.Container',
    
    
        config: {
            items: [
                {
                    xtype: 'akosplitview'
                }
            ]
        }
    
    
    });
    Is that right? (probably not, I'm ready for the worst ;-)
    • And to refer to a model (external js file), what sort of component or I-don't-know-what should I add to create an alias?
    Thanks again,
    Fernando

  4. #4
    Sencha - Architect Dev Team
    Join Date
    Jul 2012
    Posts
    270
    Vote Rating
    26
    honestbleeps will become famous soon enough honestbleeps will become famous soon enough

      0  

    Default


    Fernando,

    Since the model that he's using in that example project is an ExtJS model, this is possible, but not without some changes.

    Currently, Architect doesn't allow you to reference a model that is not in the same namespace as your Store. You'd have to update and match your namespaces for this to work. At that point, you could reference it from the Store using the appropriate class name.

    This is something that's on our todo list to improve, but I can't speak to any specific timeline on that.

    Steve
    Steve Sobel
    @honestbleeps
    Sencha Architect Development Team

  5. #5
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Pamplona - Spain
    Posts
    21
    Vote Rating
    0
    fmrc is on a distinguished road

      0  

    Default Include null object and array custom properties

    Include null object and array custom properties


    Thank you, Steve. I'd like to use Architect anyway. It seems to me that I could type the code and I'm on it, but find some trouble when inserting custom properties. e.g.
    Code:
     /**
             * @cfg {Object} [masterView=null]
             * The Component instance to be displayed on the left hand side
             * of the split view.
             */
            masterView: null,
    /**
             * @cfg {Array} [detailToolbarButtons=null]
             * An array of buttons that are added to the toolbar on top of
             * the detail component.
             */
            detailToolbarButtons: null,
    /**
             * @cfg {Boolean} [collapsed=false]
             * A flag indicating whether the split view is shown collapsed
             * (true) or expanded (false) when the component is initialized.
             */
            collapsed: false,
    Architect doesn't allow me to give a "null" value to those properties and boolean values cannot be set to "false" -they are simply ignored and not included in the code. So, is there any way to get around this?
    Thanks again,
    Fernando
    Last edited by fmrc; 4 Apr 2013 at 12:39 AM. Reason: further explanation

  6. #6
    Sencha - Architect Dev Team
    Join Date
    Jul 2012
    Posts
    270
    Vote Rating
    26
    honestbleeps will become famous soon enough honestbleeps will become famous soon enough

      0  

    Default


    Fernando,

    Glad to be able to help on the first bit -- now for the second...

    In this case, you can use processConfig within Architect to programmatically set configs, or to set configs that are outside of what Architect generally allows.

    In the config panel, search for processConfig - you can then click the + button to add a function that will process the config. You can override in there.

    Our documentation for that is here (search the doc for "process config"):

    http://docs.sencha.com/architect/2/#...e/config_panel

    Happy coding!

    Steve
    Steve Sobel
    @honestbleeps
    Sencha Architect Development Team

  7. #7
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Pamplona - Spain
    Posts
    21
    Vote Rating
    0
    fmrc is on a distinguished road

      0  

    Default No Process Config for ST

    No Process Config for ST


    Thank you, Steve. I'm coming back after being out for a while. Your last piece of advice might be good for Ext JS, but my project is for ST and there's no "Process Config" feature available. So far I've been able to integrate all the required code using Architect, but for the "null" properties (objects or arrays).
    My SA evaluation period has come to an end -only 9 days after launching it, by the way- and, believe me, I'm feeling uncertain about buying it or not (Sencha Touch Boundle) just for this silly thing. I don't understand how a configuration that must & can be set to "null" in ST, cannot be set to "null" with SA.

    Would you please have a look at the code below and tell me if it's worth keeping on wrestling with Architect?

    Code:
    Ext.define('Confirmacion.view.SplitView', {
        extend: 'Ext.Container',
        alias: 'widget.akosplitview',
    
    
        config: {
            masterView: 'thisshouldbeNULL',
            screentitle: 'Sample Split View',
            menuButtonTitle: 'Title',
            detailToolbarButtons: 'thisshouldbeNULL',
            collapsesMasterView: true,
            showToggleButton: true,
            collapsed: false,
            detailView: 'thisshouldbeNULL',
            itemId: 'splitView',
            layout: {
                type: 'hbox'
            },
            items: [
                {
                    xtype: 'container',
                    flex: 300,
                    hideAnimation: 'slideOut',
                    itemId: 'masterPanel',
                    margin: '0 1 0 0',
                    showAnimation: 'slideIn',
                    layout: {
                        type: 'fit'
                    }
                },
                {
                    xtype: 'container',
                    flex: 724,
                    itemId: 'detailPanel',
                    margin: '0 0 0 1',
                    layout: {
                        type: 'fit'
                    },
                    items: [
                        {
                            xtype: 'toolbar',
                            docked: 'top',
                            itemId: 'titleToolbar',
                            title: ' ',
                            items: [
                                {
                                    xtype: 'button',
                                    hidden: true,
                                    itemId: 'toggleButton',
                                    iconCls: 'arrow_left',
                                    iconMask: true
                                },
                                {
                                    xtype: 'button',
                                    hidden: true,
                                    hideAnimation: 'fadeOut',
                                    itemId: 'showMenuButton',
                                    showAnimation: 'fadeIn'
                                }
                            ]
                        },
                        {
                            xtype: 'container',
                            itemId: 'contentPanel',
                            layout: {
                                type: 'fit'
                            }
                        }
                    ]
                }
            ]
        },
    
    
        initialize: function() {
            this.callParent(arguments);
    
    
            var o = Ext.Viewport.getOrientation();
            this.handleOrientationChange({ orientation: o });
            Ext.Viewport.onBefore('orientationchange', 'handleOnBeforeOrientationChange', this, { buffer: 50 });
            Ext.Viewport.on('orientationchange', 'handleOrientationChange', this, { buffer: 50 });
    
    
            this.getMasterPanel().add(this.getMasterView());
            this.getContentPanel().add(this.getDetailView());
            this.setTitle(this.getScreenTitle());
    
    
            var showMenuButton = this.getShowMenuButton();
            showMenuButton.setText(this.getMenuButtonTitle());
            showMenuButton.addListener('tap', function (button, e, eOpts) {
                this.getOverlayView().showBy(button, 'tl-bc');
            }, this);
    
    
            var toolbarButtons = this.getDetailToolbarButtons();
            if (toolbarButtons) {
                this.getTitleToolbar().add(toolbarButtons);
            }
    
    
            var toggleButton = this.getToggleButton();
            toggleButton.addListener('tap', function (button, e, eOpts) {
                this.toggle();
            }, this);
            toggleButton.setHidden(!this.getShowToggleButton() || !this.getCollapsesMasterView());
        },
    
          ... etc. (the rest are functions that can be copy-pasted)
    Thank you again,
    Fernando

  8. #8
    Sencha - Architect Dev Team
    Join Date
    Jul 2012
    Posts
    270
    Vote Rating
    26
    honestbleeps will become famous soon enough honestbleeps will become famous soon enough

      0  

    Default


    Sorry for the trouble you're having Fernando, 2 things to address...

    1) Regarding your trial expiring, that shouldn't be happening after 9 days! Please email architect.feedback@sencha.com and we should be able to help extend your trial.

    2) In the case of the component you're using, an alternative to ExtJS's processConfig is to use the initialize function to set those configs.

    For configs you don't need to null out, you may not need to use initialize (it seems you may have identified a bug for custom configs you do need to set to null!). You could just type in masterView in the config panel, and click the "add" button to add custom properties. You can set the type of that config using the little circle icon - it'll give you a dropdown to let you choose Array, Boolean, Number, Object or String

    So, you'd type: masterView into the config box -- click "add" and then set it to whatever value you need.

    I am noticing, however, that when I try to set it to null, code isn't getting generated. I'll file a ticket for that so we can look into it!
    Steve Sobel
    @honestbleeps
    Sencha Architect Development Team

  9. #9
    Sencha Premium Member
    Join Date
    Nov 2010
    Location
    Pamplona - Spain
    Posts
    21
    Vote Rating
    0
    fmrc is on a distinguished road

      0  

    Default In regard to the bug

    In regard to the bug


    Thank you very much, Steve.
    • I've already requested and received an extension of my trial period.
    • I certainly tried to do what you suggest: enter the property, click "add", etc. The documentation states clearly that "Setting a config to a variable (such as current time/date) has improved in Sencha Architect 2.2. This solves two issues in earlier releases: (...) A configuration could not be set to the value null."
    I'm (or was) using SA Version: 2.2.0 Build: 908 / Release Channel: 2.2.x-stable
    So please let me know whether this is simply a matter of patience till your ticket is considered -note that my new trial period expires in 15 days- or there's a way to get around it.

    Fernando

  10. #10
    Sencha - Architect Dev Team
    Join Date
    Jul 2012
    Posts
    270
    Vote Rating
    26
    honestbleeps will become famous soon enough honestbleeps will become famous soon enough

      0  

    Default


    Fernando,

    Glad to get you rolling a bit here! For the time being, you'll need to set those configs as null programmatically with the initialize function (the same as you would using ExtJS's processConfig) - but I do have a ticket in to hopefully allow null configs in a future version/release.

    Which release that may get into, however, is not known at this time, so your best bet is initialize.

    Steve
    Steve Sobel
    @honestbleeps
    Sencha Architect Development Team

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi