PDA

View Full Version : Could i add a headerpanel for propsGrid?



hawking
25 Apr 2007, 9:20 PM
I create a propsGrid use this script:

/*
* yui-ext
* Copyright(c) 2006, Jack Slocum.
*/

var Example = {
init : function(){
var propsGrid = new YAHOO.ext.grid.PropsGrid('props-grid');
// The props grid takes an object as a data source
propsGrid.setSource({
"(name)": "Properties Grid",
"grouping": false,
"autoFitColumns": true,
"productionQuality": false,
"created": new Date(Date.parse('10/15/2006')),
"tested": false,
"version": .01,
"borderWidth": 1
});
propsGrid.render();
}
}
YAHOO.ext.EventManager.onDocumentReady(Example.init, Example, true);

and i want to add a toolbar(headerpanel like the one the inline edit grid).

i just add the follow script:
var propsGridHead = propsGrid.getView().getHeaderPanel(true);
var tb = new Ext.Toolbar(propsGridHead, [{
text: 'Select ALl',
handler : function(){
grid.getSelectionModel().selectAll();
}
}]);

But it doesnot work .

If the propsgrid doesn't support the headerpanel.

Thx.