Results 1 to 3 of 3

Thread: Problem using Ext.ux.form.ItemSelector

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    64
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Are you saying that it stays in available or that what you want to happen?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    64
    Vote Rating
    0
      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

Posting Permissions

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