Files
safekat/httpdocs/assets/js/safekat/components/tableEditor.js

44 lines
817 B
JavaScript

let TableEditor = function (
table,
url = "",
headers,
idSrc,
fields) {
this.table = table;
this.url = url;
this.headers = headers;
this.idSrc = idSrc;
this.fields = fields;
this.editor = null;
this.init = function () {
if (url == "") {
this.editor = new $.fn.dataTable.Editor({
table: table,
idSrc: idSrc,
fields: fields,
});
}
else {
this.editor = new $.fn.dataTable.Editor({
ajax: {
url: url,
headers: headers,
},
table: table,
idSrc: idSrc,
fields: fields,
});
}
};
}
export default TableEditor;