1. #1
    Ext User
    Join Date
    Jan 2008
    Posts
    25
    Vote Rating
    0
    smruti_patra is on a distinguished road

      0  

    Default Multiple renderer in Grid Column model

    Multiple renderer in Grid Column model


    I want to use to renderer in the column model.when i am using two one is working other is not working.

    I have one column to display the editable cell with money value in usMoney format and disaply the background in some color.

    i am attching my code here with for reference.

    When i am adding the color randerer the Usmoney randerer is not working. Please let me know if any body has idea on same.

    Thanks In advance.
    Smruti.
    Code:
    function pass1Color(val, cell, record, rowIndex, colIndex, store){
    			cell.attr = 'style="background: #E3F5F9; !important;"';		
    			//setrenderer:Ext.util.Format.usMoney;			
    			return val;
    	};
    
    var cm = new Ext.grid.ColumnModel([	 	
    	 	{header: "fiscalYearId",hidden: true,hideable: false, dataIndex: 'fiscalYearId'},
    	 	{header: "durationTypeCodeId",hidden: true,hideable: false, dataIndex: 'durationTypeCodeId'},
    		
    		{
    			header:Ext.CurrentWeek1, 
    			width: 175, 
    			sortable: true, 
    			dataIndex:'currentWeekPass1',
    			align: 'center',	
    			groupable:false,					
    			renderer:Ext.util.Format.usMoney,					
    			editor: new Ext.form.NumberField({
    				//specify options
    				allowBlank: false,  //default is true (nothing entered)
    				allowNegative: false //could also use minValue
    			}),
    			renderer:pass1Color
    		}
    		
    
            ]);

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    when you set a config object like that, the last item wins.
    PHP Code:
    var = { 
       
    test 'test' ,
       
    'y',
       
    test :'false' 
    }; 
    x.test will equal 'false'

  3. #3
    Ext User
    Join Date
    Jan 2008
    Posts
    25
    Vote Rating
    0
    smruti_patra is on a distinguished road

      0  

    Default


    Cau you please tell me how to handel this situation?

  4. #4
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    use one renderer.

  5. #5
    Ext JS Premium Member
    Join Date
    Mar 2008
    Posts
    28
    Vote Rating
    0
    wanderAround is on a distinguished road

      0  

    Default


    Quote Originally Posted by smruti_patra View Post
    Cau you please tell me how to handel this situation?
    Combine them into one renderer, since you can only set one.
    In other words,
    Code:
    function pass1Color(val, cell, record, rowIndex, colIndex, store){
    			cell.attr = 'style="background: #E3F5F9; !important;"';		
    			return Ext.util.Format.usMoney(val);
    	};
    I think that would work.