Results 1 to 5 of 5

Thread: [2.1] Combo in EditorGrid showing wrong value

  1. #1
    Sencha User kouphax's Avatar
    Join Date
    Mar 2007
    Location
    Belfast
    Posts
    58

    Default [2.1] Combo in EditorGrid showing wrong value

    Hello,

    I am reporting another potential bug in the 2.1 release.

    Browser Information: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

    The code below works as expected most of the time however if you follow these step when you attempt to edit one of the values in the grid you will get the "unrendered" version of the field value.

    1. Set focus on the "Access Level" column of the first item in the grid.
    2. Type in "Super" and hit return
    3. Press tab.

    The bug should be apparent there.

    Code:
    var userLevels = [
    	['0','None', '<span style="color:grey;">No Access</span>'],
    	['1','User', '<span>User</span>'], 
    	['2','Supervisor', '<span>Supervisor</span>'],
    ];
    
    var addUserForm = new Ext.form.FormPanel({
    	layout:'form',
    	bodyStyle:'padding:5px 5px 0',
    	items : [	
    		{
    			xtype:'fieldset',
    			autoHeight:true,
    			title:'User Information',
    			items :[
    				{
    					xtype:'textfield',
    					maxLength:5,
    					minLength:5,
    					maskRe:/[0-9]{1,5}/,
    					fieldLabel:"Staff Number",
    					name:"staffId",
    					allowDecimals:false,
    					allowNegative:false,
    					width : 75,
    					allowBlank:false
    				},{
    					xtype:'textfield',
    					fieldLabel:"Name",
    					name:"name",
    					width : 200,
    					allowBlank:false,
    					maxLength:24
    				},{
    					xtype:'combo',
    					width:75,
    					name:'level',
    					fieldLabel:'Level',
    					store : [['1','User'],['3','Admin']],
    					triggerAction:'all',
    					allowBlank : false
    				}		
    			]
    		},{
    			xtype:'fieldset',
    			title:'Group Membership',
    			autoHeight:true,
    			items:
    			{
    				id:'user-grid',
    				xtype:'editorgrid',
    		        store: new Ext.data.SimpleStore({
    			        fields: [
    			        	{name: 'id', type:'int'},
    			            {name: 'group'},
    			            {name: 'member', type:'int'}
    			        ],
    			        data: [						
    						[1,'XXX',0],
    						[2,'XXX',0],
    						[3,'XXX',0]
    					]
    			    }),
    			    clicksToEdit:1,
    		        columns: [
    		            {id:'group',header: "Group Set", width: 170, sortable: false, dataIndex: 'group'},
    		            {id:'member',header: "Access Level", width: 150, sortable: false, dataIndex: 'member',
    		            	editor : new Ext.form.ComboBox({
    							store : userLevels,
    							triggerAction:'all',
    							selectOnFocus:true
    		            	}),
    		            	renderer : function(v){
    		            		return userLevels[v][2];
    		            	}
    		            }
    		        ],		      
    		        stripeRows: true,
    		        autoHeight:true,
    		        autoScroll:false,
    		        singleSelect : false
    			}
    		}
    	],
    	frame:true,
    	buttonAlign : 'right',
        buttons: [{
            text: 'Save',
            handler : function(){
            	var frm = addUserForm.getForm();
            	if(frm.isValid()){
            		//todo
            	}else{        		
            		frm.submit();
            	}
            }
        },{
            text: 'Cancel'
        }]		
    })
    
    
    var addWindow = new Ext.Window({
    	title:'Add New User',
    	iconCls:'my-icon',
    	items : addUserForm,
    	width : 380,
    	autoHeight:true,
    	resizable:false,
    	border:false	
    });
    
    addWindow.show();

  2. #2

    Default

    Hi,
    you appear to have a similar issue to mine.
    I haven't had a chance to look at your in detail but http://extjs.com/forum/showthread.ph...058#post161058 may prove relevant.

  3. #3
    Sencha User kouphax's Avatar
    Join Date
    Mar 2007
    Location
    Belfast
    Posts
    58

    Default

    Hmm not sure. Your problem seems to revolve around the issue that you where attempting to use the same record in multiple stores. I have a single store.

  4. #4

    Default

    ah well, sorry if I got your hopes up.

  5. #5
    Sencha User kouphax's Avatar
    Join Date
    Mar 2007
    Location
    Belfast
    Posts
    58

    Default

    Thanks anyway. You didn;t get my hopes up, I am only pointing out potential bugs - it doesn't really affect me :-P

Posting Permissions

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