0

嗨,我有一个带有值的网格,当我单击网格中的行时,我需要打开一个包含该行中所有值的窗口。我已经完成了加载网格并在网格中填充值。过去两周我在 ext js 工作,谁能告诉我如何进一步进行

我的代码:

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();
  }
4

1 回答 1

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
  ...
});
于 2012-07-26T08:33:20.663 回答