-
21 Apr 2008 7:13 AM #1
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 } ]);
-
21 Apr 2008 9:00 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
when you set a config object like that, the last item wins.
x.test will equal 'false'PHP Code:var x = {
test : 'test' ,
y : 'y',
test :'false'
};

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
21 Apr 2008 10:23 PM #3
Cau you please tell me how to handel this situation?
-
22 Apr 2008 5:29 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
use one renderer.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
7 May 2008 12:39 PM #5
Combine them into one renderer, since you can only set one.
In other words,
I think that would work.Code:function pass1Color(val, cell, record, rowIndex, colIndex, store){ cell.attr = 'style="background: #E3F5F9; !important;"'; return Ext.util.Format.usMoney(val); };


Reply With Quote