1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    11
    Vote Rating
    0
    vp2 is on a distinguished road

      0  

    Default variable value with label in Sencha Architect

    variable value with label in Sencha Architect


    Hi,

    items: [ { xtype: 'label',
    cls: [ 'bolded', 'italic', 'titleText' ],
    html: 'Welcome John Doe.',
    id: 'sphWelcome'
    }]

    How can I replace a First Name and a Last Name in the above code with variable in sencha architect. If I do this using Notepad as shown below it works. I have this code straight into the view, there is no separate controller to create this label.

    items: [ {
    xtype: 'label',
    cls: [ 'bolded', 'italic', 'titleText' ],
    html: 'Welcome' + ' ' + localStorage.FName + ' ' + localStorage.LName + '.',
    id: 'sphWelcome'
    }]

    Thanks,
    -VP2

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,883
    Vote Rating
    102
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    VP2 -

    Literal values (variables) are not supported in the configuration editor yet.

    I'd recommend setting the html to a standard "Welcome" and then based on some event such as "show", getting a reference to sphWelcome and invoking setHtml on it.

    This also may help you down the road if you decide to implement the ability to logout and login as a different user.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User filippo.ferrari's Avatar
    Join Date
    Apr 2010
    Location
    Sanremo - Italy
    Posts
    124
    Vote Rating
    1
    filippo.ferrari has a reputation beyond repute filippo.ferrari has a reputation beyond repute filippo.ferrari has a reputation beyond repute filippo.ferrari has a reputation beyond repute filippo.ferrari has a reputation beyond repute filippo.ferrari has a reputation beyond repute filippo.ferrari has a reputation beyond repute filippo.ferrari has a reputation beyond repute filippo.ferrari has a reputation beyond repute filippo.ferrari has a reputation beyond repute filippo.ferrari has a reputation beyond repute

      0  

    Default


    I've the same request but my goal is using variables with url property to switch from test to production:

    PHP Code:
    Ext.define('Ch.model.Chiamate', {
        
    extend'Ext.data.Model',

        
    proxy: {
            
    type'ajax',
            
    urlmyPathGlobalDefined '/myscript.php',
            
    reader: {
                
    type'json',
                
    messageProperty'message',
                
    root'chiamate',
                
    totalProperty'risultati'
            
    }
        },

        
    fields: [
            {
    ..... 
    Any suggestion?

  4. #4
    Sencha Premium Member intellix's Avatar
    Join Date
    Mar 2012
    Location
    UK + Malta
    Posts
    263
    Vote Rating
    18
    intellix will become famous soon enough

      0  

    Default


    I've made a little hack (atm I'm using it for locale changing) and it might be helpful:

    http://www.sencha.com/forum/showthre...l=1#post863022

  5. #5
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,181
    Vote Rating
    77
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    Quote Originally Posted by filippo.ferrari View Post
    I've the same request but my goal is using variables with url property to switch from test to production
    I'm still don't get it why people asks that.

    Just make your URL relative, for example: "./myscript.php" so is independent in which server/context the application runs.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 MVC
    Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
    Application Server: Glassfish 3.1.x
    Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5

    If you like my answer please vote!

  6. #6
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,181
    Vote Rating
    77
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      1  

    Default


    Quote Originally Posted by vp2 View Post
    Hi,
    How can I replace a First Name and a Last Name in the above code with variable in sencha architect. If I do this using Notepad as shown below it works. I have this code straight into the view, there is no separate controller to create this label.
    Change your mental model from "web page" to "ui component":

    label.setText( 'Welcome' + ' ' + localStorage.FName + ' ' + localStorage.LName + '.');

    after success login in the login event.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 MVC
    Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
    Application Server: Glassfish 3.1.x
    Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5

    If you like my answer please vote!

  7. #7
    Sencha Premium Member intellix's Avatar
    Join Date
    Mar 2012
    Location
    UK + Malta
    Posts
    263
    Vote Rating
    18
    intellix will become famous soon enough

      0  

    Default


    Quote Originally Posted by ssamayoa View Post
    I'm still don't get it why people asks that.

    Just make your URL relative, for example: "./myscript.php" so is independent in which server/context the application runs.

    Regards.
    Because our API has many languages (and is sending back translated content) like:
    /en/event
    /de/event

    So I want to do: /{locale}/event

    Sure... I could get around it by sending a cookie or something

  8. #8
    Sencha Premium Member
    Join Date
    May 2010
    Location
    Guatemala, Central America
    Posts
    1,181
    Vote Rating
    77
    ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough ssamayoa is a jewel in the rough

      0  

    Default


    Quote Originally Posted by intellix View Post
    /en/event
    /de/event
    Revert the order of the url

    /event/{lang}

    Then change from path param to query param:

    /event?lang=en

    BTW I was refering to the Filippo's example.

    Regards.
    UI: Sencha Architect 3.x / ExtJS 4 MVC
    Server side: EJB 3.1 / CDI / JPA 2 / JAX-RS / JasperReports
    Application Server: Glassfish 3.1.x
    Databases: Oracle 10g & 11g / DB2 9 & 10 / Firebird 2.5

    If you like my answer please vote!

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar