mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
44 lines
817 B
JavaScript
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;
|
|
|