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

      0  

    Default Unanswered: Problem using Ext.ux.form.ItemSelector

    Unanswered: Problem using Ext.ux.form.ItemSelector


    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 when item is double clicked it moves 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 override 'moveRec' method as shown in code and it works now what i want is when i double click on item of Selected Panel they need to be removed from Selected list and it does not goes back to Available list but I am not able to do this:

    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();
        }
    
    
    });

    Please help me.Thanks in advance

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Answers
    3542
    Vote Rating
    846
    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


    Are you saying that it stays in available or that what you want to happen?
    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.

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

      0  

    Default


    Thanks Mitchell Simoens

    Let me expalin in steps:

    Step 1: At start Ext.ux.form.ItemSelector has 2 panels 'Available' and 'Selected' , 'Available' has items 'a' and 'b'.and Selected panel list empty.
    Step2: Double click 'a' , Available has 'a' and 'b' , Selected has 'a' .//works fine
    Step3: Double click 'a' of Selected panel , now Available must have 'a' and 'b' only and not 'a' ,'b' and 'a' and Selected panel list must be empty. // not working

    Hope i am clear this time

Thread Participants: 1