backgrid.js删除已选中

时间:2013-12-17 08:05:17

标签: javascript backgrid

我正在尝试向数据网格添加删除按钮(使用backgrid.js http://backgridjs.com/

我有一个选择行

var grid = new Backgrid.Grid({
  columns: [{

    // name is a required parameter, but you don't really want one on a select all column
    name: "id",

    // Backgrid.Extension.SelectRowCell lets you select individual rows
    cell: "select-row",

  }].concat(columns),
  collection: contacts
});

按钮:

<button id= "button" type="button">Delete</button>

$('#button').click(function () {

});

但我如何获得所选的行ID?并将其发送到服务器,从DB中删除数据?

1 个答案:

答案 0 :(得分:0)

documentation上有一个条目,描述Grid#getSelectedModels