Results 1 to 3 of 3

Thread: Getting Started - Using Sencha CMD *Problem*

  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

  2. #2
    Sencha MVP Team Member
    Join Date
    Sep 2016
    Location
    Kennewick, WA
    Posts
    150
    Answers
    15

    Default

    With you saying yours is not working, something is missing in your code in order to help you resolve the issue.

    As seen in the fiddle below it is working as expected.

    Please provide some additional information.
    Andy Allord
    Sencha MVP/Software Engineer

  3. #3

    Default

    The code provided is an exact copy of the Getting Started Sencha Cmd exercise. Take a moment to build the small example app per the instructions and you will see what I am referring too.

    Here is the link to the application source code:

    https://www.dropbox.com/sh/nsvtiwe6b...0Bvn9HgRa?dl=0


    Again in an attempt to see if the issue was an error in typing, I just named the folders and files and copied in the code from the website.

    Thanks

Posting Permissions

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