0

igGrid 是否支持列编辑/新模板?

我有一个定义如下的网格。但是在编辑/添加新行时模板将不起作用。“ChooseEmployee”功能显示一个弹出对话框供用户选择员工。

$(function() {
  var employees = [{
    Id: 1,
    "Name": "John, Smith",
    "DirectReports": "Mary, Ann;David,Lowe"
  }, {
    Id: 2,
    "Name": "Mary, Ann",
    "DirectReports": "Kelly,Walsh;Kevin, Edwards;Terri, Gibson"
  }];
 
  $('#grid1').igGrid({
    dataSource: employees,
    primaryKey: "Id",
    autGenerateColumns: false,
    width: "100%",
    columns[{
      headerText: "Id",
      key: "Id",
      dataType: "number",
      width: 100
    }, {
      headerText: "Name",
      key: "Name",
      dataType: "string",
      width: 120
    }, {
      headerText: "Reports",
      key: "DirectReports",
      dataType: "object",
      width: 300,
      template: "<div style='clear:both'><div style='overflow:hidden;white-space:wrap;max-width:320px;width:320px;float:left;'>${DirectReports}</div><input type='button' onclick='chooseEmployees(${Id});' value='...' style='float:left;' /></div>"
    }], 
   features: [ {name: "Updating", enableAddRow: true, editMode: "row" } ] 
  });

});
<table id="grid1"></table>

4

1 回答 1

0
于 2014-11-13T07:29:21.063 回答