-
21 Jun 2012 7:14 AM #1
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
-
21 Jun 2012 8:11 AM #2
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 Aug 2012 3:28 AM #3
I've the same request but my goal is using variables with url property to switch from test to production:
Any suggestion?PHP Code:Ext.define('Ch.model.Chiamate', {
extend: 'Ext.data.Model',
proxy: {
type: 'ajax',
url: myPathGlobalDefined + '/myscript.php',
reader: {
type: 'json',
messageProperty: 'message',
root: 'chiamate',
totalProperty: 'risultati'
}
},
fields: [
{
.....
-
3 Aug 2012 3:58 AM #4
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
-
3 Aug 2012 8:36 AM #5
UI: Sencha Architect 2.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!
-
3 Aug 2012 8:41 AM #6
UI: Sencha Architect 2.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!
-
3 Aug 2012 8:48 AM #7
-
3 Aug 2012 11:48 AM #8
UI: Sencha Architect 2.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!


Reply With Quote
