Results 1 to 3 of 3

Thread: Getting Started - Using Sencha CMD *Problem*

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Getting Started - Using Sencha CMD *Problem*

    The bind expression for the text property ( "text: '{userName ? "Save: "+ userName : "Save"}' ) returns the entire expression as a string. It does perform any logic over it. What am I doing wrong. Is there any other file you need to see (I have copied Main.js below)?





    Ext.define('MyApp.view.main.Main', {
    extend:'Ext.tab.Panel',
    controller:'main',

    requires: [
    'Ext.Button',
    'Ext.field.Text'// <<== added
    ],

    viewModel: { // <<== added
    data: {
    userName:''
    }
    },

    items: [{
    title:'Home',
    html:'<h1 class="main-banner">Hello World!<h1>',
    items: [{
    xtype:'textfield', // <<== added
    label:'User name',
    bind:'{userName}'
    }, {
    xtype:'button',
    handler:'onGo',
    bind: { // <<== added
    disabled:'{!userName}',
    text:'{userName ? "Save: " + userName : "Save"}'
    }
    }]
    }, {
    title:'Notifications'
    }, {
    title:'Settings'
    }]
    });
    Attached Images Attached Images

Posting Permissions

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