Results 1 to 4 of 4

Thread: Add event to input

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User coshmos's Avatar
    Join Date
    Apr 2012
    Vote Rating

    Default Answered: Add event to input


    I create number inputs by the way described below:

    var quantityInput = this.createNumberInput('Quantity', 'QuantityLabel', 0, 0, 100);
    createNumberInput: function (name, label, defaultValue, minimumValue, maximumValue) {
        var input = {};
        input.xtype = 'numberfield';
        input.fieldLabel = label;
        input.hiddenName = name + 'ID'; = this.inputPrefix + '.' + name; = name;
        input.value = defaultValue;
        input.minValue = minimumValue;
        input.maxValue = maximumValue;
        return input;
    How I could add event 'change' to the quantityInput?

  2. If you want to do it in your createNumberInput function you can specify a listeners object so that once it gets created it uses it.!...-cfg-listeners

    Or after it is created or if you used Ext.create instead of an anonymous object you could call quantityInput.on( 'change', someFunction )!

    Or if you were to use MVC you could control all your inputs from the controller!...method-control

Tags for this Thread

Posting Permissions

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