很郁闷,这段代码是写在单独的js文件里的,但是网上的帮助文档也看过了,我只想知道,这个A是从哪里传入的,他应该是实参吧,我只想知道A这个值是从哪里读取到的,谢谢,我是菜鸟,不要见笑Ext.grid.ColumnModel = function(A) {
//alert(A);
this.defaultWidth = 100;
this.defaultSortable = false;
if (A.columns) {
Ext.apply(this, A);
this.setConfig(A.columns, true)
} else {
this.setConfig(A, true)
}
this.addEvents("widthchange", "headerchange", "hiddenchange",
"columnmoved", "columnlockchange", "configchange");
Ext.grid.ColumnModel.superclass.constructor.call(this)
};
//alert(A);
this.defaultWidth = 100;
this.defaultSortable = false;
if (A.columns) {
Ext.apply(this, A);
this.setConfig(A.columns, true)
} else {
this.setConfig(A, true)
}
this.addEvents("widthchange", "headerchange", "hiddenchange",
"columnmoved", "columnlockchange", "configchange");
Ext.grid.ColumnModel.superclass.constructor.call(this)
};
new Ext.grid.ColumnModel(this.columns);
是这种格式么 ,但是我没有找到this.columns这个变量
他是这样去写的:Ext.grid.GridPanel = Ext.extend(Ext.Panel, {
ddText : "{0} selected row{1}",
minColumnWidth : 25,
trackMouseOver : true,
enableDragDrop : false,
enableColumnMove : true,
enableColumnHide : true,
enableHdMenu : true,
stripeRows : false,
autoExpandColumn : false,
autoExpandMin : 50,
autoExpandMax : 1000,
view : null,
loadMask : false,
deferRowRender : true,
rendered : false,
viewReady : false,
stateEvents : [ "columnmove", "columnresize", "sortchange" ],
initComponent : function() {
Ext.grid.GridPanel.superclass.initComponent.call(this);
this.autoScroll = false;
this.autoWidth = false;
if (Ext.isArray(this.columns)) {
alert(this.columns);
this.colModel = new Ext.grid.ColumnModel(this.columns);
delete this.columns
}...................
........................
v
ar colModel = new Ext.grid.ColumnModel([
{header: "Ticker", width: 60, sortable: true},
{header: "Company Name", width: 150, sortable: true},
{header: "Market Cap.", width: 100, sortable: true},
{header: "$ Sales", width: 100, sortable: true, renderer: money},
{header: "Employees", width: 100, sortable: true, resizable: false}
]);这个我也不太懂。那个this.columns不知道是个什么东西