嗨我有一个有值的网格, 当我点击我需要的网格中的行时 打开一个窗口,其中包含该行中的所有值。 我已经完成了加载网格并在网格中填充值。我在过去两周的分机工作,任何人都可以告诉我如何进一步
我的代码:
function loadcolleaguesVal(jsonContent){
var localJson = Ext.util.JSON.decode(jsonContent);
colleagueGridJS=Ext.util.JSON.decode(localJson.ColleagueInfo);
colleagueGridDataJS=Ext.util.JSON.decode(localJson.colData);
var caseReGridData= new Ext.data.JsonStore({
autoLoad :true,
fields: ["NAME",
"TOTAL_CASES_ALLOWED",
"TOTAL_OPEN_CASES",
"CLIENT_TEAM_CASES_ALLOWED",
"CLIENT_TEAM_TOTAL_CASES",
"PAY_AUTH_MAX",
"DAYS_MAX",
"LUMP_SUM_MAX",
"DENIAL_ADMIN",
"DENIAL_CLINICAL"],
storeId :'ColleagueInfo',
data : colleagueGridDataJS,
root : 'data',
listeners : {
load : colleagueGridListerner
}
});
}
function colleagueGridListerner(){
nucleus.tools.master(colleagueGridJS,"NonEditableGrid","colleagueGrid",caseReGridData,"twoFields");
panelForPage.addButton({
text:'Add new colleague',
type:'Submit',
name:'btnGo',
handler:function()
{
showColleagueSetup();
}
});
Ext.getCmp('colleagueCenter').add(panelForPage);
Ext.getCmp('colleagueGrid_Grid').setHeight(145);
Ext.getCmp('colleagueGrid_Grid').doLayout();
tabPanel.doLayout();
Ext.getCmp("colleagueGrid_Grid").collapse();
}
答案 0 :(得分:0)
我无法在代码中看到网格,但您可以将选择模型添加到网格中:
var grid = new Ext.grid.GridPanel({
.
.
.
sm:new Ext.grid.RowSelectionModel({singleSelect:true}),
.
.
});
并添加事件:
grid.getSelectionModel().on('rowselect', function (selModel, rowIndex, record ) {
//Your row selected data is:
var data = record.data;
//Open window code
...
});