Я пользуюсь дополнительными виджетами от Webix для JS. Добавляя кнопку Удалить с методом remove(), ничего не происходит.
{% extends "base.html" %}
{% block content %}
<script type="text/javascript" charset="utf-8">
var grid_data = [
{ id:1, title:"The Shawshank Redemption", year:1994, votes:678790,
rating:9.2, rank:1},
{ id:2, title:"The Godfather", year:1972, votes:511495, rating:9.2,
rank:2},
{ id:3, title:"The Godfather: Part II", year:1974, votes:319352,
rating:9.0, rank:3},
{ id:4, title:"The Good, the Bad and the Ugly", year:1966, votes:213030,
rating:8.9, rank:4},
{ id:5, title:"My Fair Lady", year:1964, votes:533848, rating:8.9,
rank:5},
{ id:6, title:"12 Angry Men", year:1957, votes:164558, rating:8.9, rank:6}
];
function addItem(){
$$("table").add({ title:"New item" });
};
function delItme(){
var list = $$("table");
var item_id = list.getSelectedId();
if (item_id){
list.remove(item_id);
}
}
webix.ui({
rows:[
{ view:"toolbar", elements:[
{ view:"button", value:"Add item", click:addItem },
{view:"button", value:"Delete", click:delItme
}
]},
{
view:"datatable",
id:"table",
editable:true,
columns:[
{ id:"title", fillspace:true, header:"Title", editor:"text" },
],
}
]
});
$$("table").parse(grid_data);
</script>
{% endblock %}
{% block footer %}
{% endblock %}