0

I'm trying to bind a label of a textfield basing on a condition. So looks like i should use 'formulas'. I'm trying a simple example but binding does not work. I'm using Extjs 6.2.1 modern toolkit

Ext.define('Class', {
    extend: 'Ext.Container',
    formulas: {
      secondString: function (get) {
          var test = 'test';
          return test;
      }
    },
    items: [
        {
            xtype: 'fieldset',
            title: 'title',
            items: [
                {
                    xtype: 'textfield',
                    label: 'first string',
                    bind: {
                        label: '{secondString}'
                    }
                }
            ]
        }
    ]
});

1 Answers1

-1

Formula:

This class manages a formula defined for an Ext.app.ViewModel.

Formula Basics Formulas in a ViewModel can be defined as simply as just a function:

Try this

https://fiddle.sencha.com/#fiddle/2tom&view/editor

KamilloPL
  • 34
  • 8