[code="java"]
JBXX_Panel = Ext.extend(Ext.I.RoleCrudPanel, {
id: "JBXX_PanelId",
title: "测试",
//width: 400,
//height: 300,
//这个是数据源url
baseUrl: "DATA/B_BSC/BscPager.aspx",
storeMapping: ["bh_bsc","bscmc","jc"],
ID: "bh_swdjh",// 编辑与删除标记
inportUri:"DATA/InToExcel.aspx",
RoleId:null ,
constructor: function(){
alert(this.RoleId); //取不到值 为空
this.sm = new Ext.grid.CheckboxSelectionModel();
this.cm = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),//获得行号
this.sm,{
header:"名称",
dataIndex:"mc",
sortable:true
}
]);
JBXX_Panel.superclass.constructor.call(this);
}
});
在调用的时候
Panel = new JBXX_Panel({
RoleId:"aaaaa" //怎么把 这个 RoleId 传入进去呢 ?
});[/code]
这样就可以了
[code="js"]
JBXX_Panel = Ext.extend(Ext.I.RoleCrudPanel, {
id : "JBXX_PanelId",
title : "测试",
baseUrl : "DATA/B_BSC/BscPager.aspx",
storeMapping : ["bh_bsc", "bscmc", "jc"],
ID : "bh_swdjh",
inportUri : "DATA/InToExcel.aspx",
RoleId : null,
constructor : function(cfg) {
JBXX_Panel.superclass.constructor.call(this,cfg);
alert(this.RoleId);
this.sm = new Ext.grid.CheckboxSelectionModel();
this.cm = new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(),// 获得行号
this.sm, {
header : "名称",
dataIndex : "mc",
sortable : true
}]);
JBXX_Panel.superclass.constructor.call(this);
}
});
Ext.onReady(function() {
Panel = new JBXX_Panel({
RoleId:"aaaaa"
});
})
[/code]