Slick Grid - 在按输入类型文本添加值时,gridters.delete不会显示在网格中

时间:2015-07-07 10:45:56

标签: javascript slickgrid

我有一个包含两列的网格:名称和删除。当用户输入输入文本值并单击该按钮时,该值将添加到网格中。问题是“删除”列不起作用,“删除”列不显示任何内容。请参阅以下代码:

grid = new Slick.Grid("#mygrid", gridData.Selections, columns, options);
grid.setSelectionModel(new Slick.CellSelectionModel());
$("#btnAddValue").click(function () {
    var newItem = { "SelectionName": $("#Name").val() };
    $('#pickListName').val('');
    var item = newItem;
    data = grid.getData();
    grid.invalidateRow(data.length);
    data.push(item);
    grid.updateRowCount();
    grid.render();
});

var columns = [
  { id: "SelectionName", name: "Name", field: "SelectionName", width: 420, cssClass: "cell-title", validator: requiredFieldValidator },
  { id: "Id", name: "Delete", field: "Id", width: 80, resizable: false, formatter: Slick.Formatters.Delete }];
var options = {
enableAddRow: true,
enableCellNavigation: true,
asyncEditorLoading: false,
autoEdit: true};

应该如何解决这个问题? 谢谢

0 个答案:

没有答案