1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    0
    s.samadzadeh is on a distinguished road

      0  

    Default Extend one Ext.window.Window class from another, buttons configuration problem

    Extend one Ext.window.Window class from another, buttons configuration problem


    Hi all, I have a problem with extends functionality

    I have two window view object. Edit and Add
    They are totally same so I extend Edit from Add window like this:
    Code:
    Ext.define('AM.view.user.Add', {extend: 'Ext.window.Window',alias: 'widget.useradd',...
    Code:
    Ext.define('AM.view.user.Edit', {extend: 'AM.view.user.Add',alias: 'widget.useredit',...
    They have two buttons (Save and Close) that are initialized in initComponent()
    I try to select and bind click event to useredit AND useradd save buttons in my controller like this:
    Code:
    'useradd button[action=save]': {click: this.doCreateUser},
    'useredit button[action=save]': {click: this.updateUser}
    But when I click Save on useredit window, doCreateUser() called instead of updateUser()
    How can I fix it?
    Thank you and sorry about my bad English

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Since the action is setup in useradd, that is used. The reference in the controller is not found, so it is jumping down to the based class. I would have a function called on your click event and then check your record for new/existing record and then redirect to add/edit function from there.

    Scott.

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    2
    Vote Rating
    0
    s.samadzadeh is on a distinguished road

      0  

    Default


    Thanks
    Scott

    I dont know why but this configuration works
    Code:
    'useredit button[action=save]': {click: this.updateUser},
    'useradd button[action=save]': {click: this.doCreateUser}

    As you can see, I change order of useredit and useradd configuration in controller, and it works!
    Is important which action bind first in these cases?

    Thank u

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi