mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-11 23:28:41 +00:00
Add remove function for rows
This commit is contained in:
parent
e56a357941
commit
4755bb39ca
|
|
@ -105,6 +105,22 @@
|
||||||
for (let i = 0; i < length; ++i) {
|
for (let i = 0; i < length; ++i) {
|
||||||
this.bindFiltering(filters[i], id);
|
this.bindFiltering(filters[i], id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const removable = this.tables[id].getRemovable();
|
||||||
|
length = removable.length;
|
||||||
|
for (let i = 0; i < length; ++i) {
|
||||||
|
this.bindRemovable(removable[i], id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
bindRemovable(remove, id)
|
||||||
|
{
|
||||||
|
remove.addEventListener('click', function (event)
|
||||||
|
{
|
||||||
|
jsOMS.preventAll(event);
|
||||||
|
|
||||||
|
document.getElementById(id).deleteRow(this.closest('tr').rowIndex);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
bindReorder(sorting, id)
|
bindReorder(sorting, id)
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,13 @@
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getRemovable()
|
||||||
|
{
|
||||||
|
return document.querySelectorAll(
|
||||||
|
'#' + this.id + ' tbody .remove'
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
getFilter()
|
getFilter()
|
||||||
{
|
{
|
||||||
return document.querySelectorAll(
|
return document.querySelectorAll(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user