Results 1 to 2 of 2

Thread: Can a controller action call a basic function?

  1. #1
    Sencha User
    Join Date
    Jun 2009
    Vote Rating

    Default Can a controller action call a basic function?


    I have some combo's which I need to call a common basic function if the select or change events fires for any of these. At the moment they are calling specific select and change functions like so:

    Ext.define('PPExtranet.controller.Customer', {
        extend: '',
        init: function() {
                "#cmbCustomerFilter": {
                    select: this.onCmbCustomerFilterSelect,
                    change: this.onCmbCustomerFilterChange
            var me = this;
        onCmbCustomerFilterSelect: function(field, value, options) {
            console.log('cmbCustomerFilterSelect cstName now: '+value[0].data.Name);
        onCmbCustomerFilterChange: function(field, newValue, oldValue, options) {
            console.log('cmbCustomerFilterChange cstName now: '+newValue);
        filterCustomersStore: function() {
    But I now want them to call a common basic function (i need to do some custom filtering on a store), however if I try and change the function name in Designer on my select and change controller actions, Designer wont let me saying that the function name is already in use or reserved.

    Does this mean in the current select and change handler functions above, I then need to make a call to my basic function?

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Vote Rating


    You are correct in your assumptions.

    In the above situation both onCmbCustomFilterSelect/onCmbCustomFilterChange should invoke filterCustomersStore. You can do this via this.filterCustomersStore();

    We don't allow binding of a single function to multiple events because even though you can do it when using raw js it can be a source of bugs and frustration. As you can see above the arguments to the function are not the same. How do you know which one to use and where it came from, etc, etc.
    Aaron Conran

Posting Permissions

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