PDA

View Full Version : textarea as grid cell renderer



valfumble
18 Oct 2010, 4:38 PM
How can I use extjs textarea as a grid cell renderer?

I tried using metaData.css = 'textarea' and it did not work.

renderer function = {return '<textare> </textarea>'} works but I do not get the style used in extjs textarea

I need this so when I click to edit the cell does not change from textfield to text area

editor textarea works fine

zachext
18 Oct 2010, 6:27 PM
You could try adding the ext css classes on the textarea. You might also want to add readonly to the textarea so that values are accidentally modified before the editor loads.



var TextAreaRenderer =
function() {return '<textarea readonly class="x-form-textarea x-form-field">' + arguments[0] +'</textarea>'}

tot2ivn
19 Oct 2010, 5:29 PM
EditorGridPanel (http://dev.sencha.com/deploy/dev/docs/?class=Ext.grid.EditorGridPanel) has config property ColumnModel (http://dev.sencha.com/deploy/dev/docs/?class=Ext.grid.ColumnModel) which has columns (http://dev.sencha.com/deploy/dev/docs/?class=Ext.grid.Column).

And in the Ext.grid.Column (http://dev.sencha.com/deploy/dev/docs/?class=Ext.grid.Column) you have editor (http://dev.sencha.com/deploy/dev/docs/source/Column.html#cfg-Ext.grid.Column-editor). You can specify textarea there.

valfumble
21 Oct 2010, 1:30 PM
Is there an easy way to render extjs form panel inside a grid cell? I need to display some buttons and a text area in the cell itself?

Thanks.

tot2ivn
21 Oct 2010, 5:55 PM
Is there an easy way to render extjs form panel inside a grid cell? I need to display some buttons and a text area in the cell itself?

Thanks.

Putting the whole form panel inside a grid cell is too cumbersome !! You can try using TriggerField (http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.TriggerField)or TwinTriggerField (http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.TwinTriggerField) as ColumnEditor.

tot2ivn
21 Oct 2010, 5:56 PM
Is there an easy way to render extjs form panel inside a grid cell? I need to display some buttons and a text area in the cell itself?

Thanks.

Putting the whole form panel inside a grid cell is too cumbersome !! You can try using TriggerField (http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.TriggerField)or TwinTriggerField (http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.TwinTriggerField) as ColumnEditor..