PDA

View Full Version : editorgridpanel and defining editor for column



tombal93
21 Jun 2010, 5:02 AM
I want to use an Editorgridpanel in ext Designer but how can i define in my grid column for exemple :

editor: {
xtype: 'textfield',
allowBlank: false
}

It seems that i can't do it with designer so perhaps in my .js ??

Hope someone can help me

In my page :



<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Cat├ęgories</title>



<script type="text/javascript">

var editor = new Ext.ux.grid.RowEditor({
saveText: 'Update'
});

var p_categories = new P_categories({
renderTo: 'liste_cat'
});
</script>


</head>

<body>

<div id="liste_cat"></div>

</body>
</html>



*.js file



P_categories = Ext.extend(P_categoriesUi, {
initComponent: function() {
P_categories.superclass.initComponent.call(this);

this.on('render', this.test, this);

},

//G_cat is ID of my grid
test: function() {
this.G_cat.plugins= editor;

// MY PROBLEM ON THIS LINE, HOW DEFINE EDITOR FOR MY COLUMN
this.G_cat.Column.RUBRIQUE_FR.editor= {xtype: 'textfield',allowBlank: false};


alert(editor.saveText);
alert(this.G_cat.title);
}


});


Thanks

jarrednicholls
22 Jun 2010, 2:59 AM
You can add any field component to a column, just as you would add a column to the grid. It will apply the field to the column's "editor" configuration. You then configure the field directly.