Skip to content

Commit 27fbc5a

Browse files
author
hikki
committed
v3.2
1 parent 3c29c79 commit 27fbc5a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

resources/assets/component.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ window.ComponentLine = class {
717717
this.OPTIONS = Object.assign({
718718
sortable: true,
719719
delete: true,
720+
insert:true
720721
}, options);
721722
/*head foot*/
722723
let foot = this.makeHead();
@@ -811,6 +812,11 @@ window.ComponentLine = class {
811812

812813
makeFoot(foot) {
813814
let tfoot = document.createElement('tfoot');
815+
if(!this.OPTIONS.insert){
816+
tfoot.insertAdjacentHTML('afterbegin', `<tr></tr>`);
817+
this.TABLE_DOM.appendChild(tfoot);
818+
return;
819+
}
814820
tfoot.insertAdjacentHTML('afterbegin', foot);
815821
this.TABLE_DOM.appendChild(tfoot);
816822
/*insert action*/
@@ -843,7 +849,7 @@ window.ComponentLine = class {
843849
this.DATA_INPUT.value = JSON.stringify(this.DATA);
844850
this.TBODY_DOM.scrollTop = this.TBODY_DOM.scrollHeight;
845851
}, false);
846-
this.DOM.getElementsByClassName('insert_handel')[0].appendChild(i);
852+
this.TABLE_DOM.querySelector('.insert_handel').appendChild(i);
847853
}
848854

849855
makeTd(td, type, value, column, attributes) {

0 commit comments

Comments
 (0)