1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    64
    Vote Rating
    0
    wasima is on a distinguished road

      0  

    Default Answered: Problem overriding functions of Ext.ux.form.ItemSelector in derived class

    Answered: Problem overriding functions of Ext.ux.form.ItemSelector in derived class


    Hi ,
    i am working on Ext.ux.form.ItemSelector, using which a window appears and we have two panels, 'Available' and 'Selected' , any item in Available panel double clicked moves to Selected panel, but i want the item double clicked to move to Selected Panel as well as retained in original list of Available items for example if 'Available' Panel had two items 'a' and 'b' , if i double clicked 'a' , 'a' will be available in 'Selected' Panel but also retained in 'Available' panel, so i tried extending base class and override these methods as shown i code:

    Code:
    Ext.define('abcd.cm.monitoring.view.Common.MonitorSelector', {
      extend: 'Ext.ux.form.ItemSelector',
        alias: 'widget.monitorselector',
        requires: [
            'Ext.ux.form.ItemSelector'
        ],
    
    
    
    
        initComponent: function() {
            var me = this;
            me.callParent();
        }
        ,
    
    
         onAddBtnClick : function() {
            var me = this,
                fromList = me.fromField.boundList,
                selected = this.getSelections(fromList);
    
    
            fromList.getStore().remove(selected);
            this.toField.boundList.getStore().add(selected);
        },
        onRemoveBtnClick : function() {
            var me = this,
                toList = me.toField.boundList,
                selected = this.getSelections(toList);
    
    
            toList.getStore().remove(selected);
         //   this.fromField.boundList.getStore().add(selected);
        },
         onItemDblClick : function(view) {
            var me = this;
            if (view == me.toField.boundList){
                me.onRemoveBtnClick();
            }
            else if (view == me.fromField.boundList) {
                me.onAddBtnClick();
            }
        }
    });

    I am not able to get desired result.can anybody help me .
    thanks in advance

  2. Why not just override the moveRec method? It's where onItemDblClick, onAddBtnClick and all them go to.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,801
    Answers
    3467
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Why not just override the moveRec method? It's where onItemDblClick, onAddBtnClick and all them go to.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    64
    Vote Rating
    0
    wasima is on a distinguished road

      0  

    Default


    Thanks Michelle,


    but there is no function called 'moveRec' in base class or derived class , which function are u talking about ?
    and how do i override a method in derived class ?

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,801
    Answers
    3467
    Vote Rating
    834
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    My name isn't "Michelle".

    I'm guessing you are using an older version? The latest public release (4.1.1) has this moveRec method in it.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  6. #5
    Sencha User
    Join Date
    Dec 2011
    Posts
    64
    Vote Rating
    0
    wasima is on a distinguished road

      0  

    Default


    Thanks Mitchell Simoens.

    I am using 4.1.1 only this is code i tried overriding 'moveRec' function you told but couldn't get desired results.

    Code:
    Ext.define('abcd.cm.monitoring.view.Common.MonitorSelector', {
        extend: 'Ext.ux.form.ItemSelector',
        alias: 'widget.monitorselector',
        requires: [
            'Ext.ux.form.ItemSelector'
        ],
    
    
        initComponent: function() {
            var me = this;
            me.callParent();
        }
        ,
        moveRec: function(add, recs) {
            var me = this,
                fromField = me.fromField,
                toField   = me.toField,
                fromStore = add ? fromField.store : toField.store,
                toStore   = add ? toField.store   : fromField.store;
    
    
            fromStore.suspendEvents();
            toStore.suspendEvents();
           // fromStore.remove(recs);
            toStore.add(recs);
            fromStore.resumeEvents();
            toStore.resumeEvents();
    
    
            fromField.boundList.refresh();
            toField.boundList.refresh();
    
    
            me.syncValue();
        }
    });



  7. #6
    Sencha User
    Join Date
    Dec 2011
    Posts
    64
    Vote Rating
    0
    wasima is on a distinguished road

      0  

    Default


    Thanks Mitchell Simoens..
    i tried overrding method 'moveRec' and it worked but issue i am facing now is :

    In 'Available ' list if i have items a b c and d and i double click on 'a' , a copy of 'a' is sent to 'Selected ' list and 'a' is retained in 'Available' list as well as i wanted , but when i double click on 'a' of 'Available' list again the items in the 'Selected' list must be 'a' and 'a' that is 2 copies of 'a' in Selected list but that's not happening .It(Selected list) just conatins only one copy of 'a' now but i need 2 copies of 'a' here.
    Here is code:

    Code:
    Ext.define('abcd.cm.monitoring.view.Common.MonitorSelector', {
        extend: 'Ext.ux.form.ItemSelector',
        alias: 'widget.monitorselector',
        requires: [
            'Ext.ux.form.ItemSelector'
        ],
    
    
        initComponent: function() {
            var me = this;
            me.callParent();
        } ,
        onAddBtnClick : function() {
           var me = this,
               selected = me.getSelections(me.fromField.boundList);
    
    
          me.moveRec(true, selected);
           me.toField.boundList.getSelectionModel().select(selected);
       }
    
    
        , moveRec: function(add, recs) {
            var me = this,
                fromField = me.fromField,
                toField   = me.toField,
                fromStore = add ? fromField.store : toField.store,
                toStore   = add ? toField.store   : fromField.store;
    
    
            fromStore.suspendEvents();
            toStore.suspendEvents();
           // fromStore.remove(recs);
            toStore.add(recs);
            fromStore.resumeEvents();
            toStore.resumeEvents();
    
    
            fromField.boundList.refresh();
            toField.boundList.refresh();
    
    
            me.syncValue();
        }

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