PDA

View Full Version : Could you do me a favor? I meet some problem



extjs_alan
9 Aug 2009, 9:33 PM
my main idea is that i want to change the RowEditor to be a RowFilter . like this :http://p0.images22.51img1.com/6000/li67015535/0ca03851fe847c63077fa00ab28b59ef.gif


i meet a problem in my first step. uh. bad lucky .:s

init : function(grid) {
this.grid = grid;
this.ownerCt = grid;
if (grid.isfilter) {
//grid.getTopToolbar().addButton(new Ext.Button({text:'isfilter'})); <-- It's not work ,error:addButton is not a function() .
}

tubamanu
9 Aug 2009, 10:53 PM
u want to add a button to your toolbar?



initToolBar: function () {
this.theGridToolbar = new Ext.Toolbar({
items: [{
text:'Add',
tooltip:'Add a new project',
handler: function () {
alert("fwefew");
}
}]
});
}




initUserGrid: function () {
this.theUserGrid = new Ext.grid.GridPanel({
.
.
.
tbar: this.theGridToolbar
});
}

extjs_alan
9 Aug 2009, 11:10 PM
u want to add a button to your toolbar?



initToolBar: function () {
this.theGridToolbar = new Ext.Toolbar({
items: [{
text:'Add',
tooltip:'Add a new project',
handler: function () {
alert("fwefew");
}
}]
});
}




initUserGrid: function () {
this.theUserGrid = new Ext.grid.GridPanel({
.
.
.
tbar: this.theGridToolbar
});
}




Thanks ,but I don't think so . :-|
RowEditor.js



init: function(grid){
this.grid = grid;
this.ownerCt = grid;
//added
if (grid.isfilter) {
grid.getTopToolbar().insert(1,[{
text:"filter",
cls:"x-btn-text-icon",
handler:function(){...},
scope : this
},"-"] );
}
..
..


the code firebug : grid.getTopToolbar().insert is not a function Why?????? ??????????????

Animal
9 Aug 2009, 11:20 PM
Thanks ,but I don't think so . :-|
RowEditor.js



init: function(grid){
this.grid = grid;
this.ownerCt = grid;
//added
if (grid.isfilter) {
grid.getTopToolbar().insert(1,[{
text:"filter",
cls:"x-btn-text-icon",
handler:function(){...},
scope : this
},"-"] );
}
..
..


the code firebug : grid.getTopToolbar().insert is not a function Why?????? ??????????????

At the time init is called, the grid has not been rendered.

A plugin must either hook into the onRender/afterRender template method, or use a listener on the render or afterrender event to process its client Component's DOM structure.