|
@@ -55,20 +55,20 @@ setTimeout(function(){
|
|
|
|
|
|
// $s.textarea; $s.select; $s.dzen; $s.check1; $s.note; $s.married; //just for init
|
|
|
function btnDel(){
|
|
|
- var arr = $s.hashTable.slice();
|
|
|
- var thisLine = this.parentElement.parentElement;
|
|
|
- arr.splice(thisLine.rowIndex -1,1)
|
|
|
- $s.hashTable = arr;
|
|
|
- $s.btnDel = {onclick: btnDel};
|
|
|
+ var arr = $s.hashTable.slice(); //copy
|
|
|
+ var thisLine = this.parentElement.parentElement; //current row
|
|
|
+ arr.splice(thisLine.rowIndex -1,1) //cut one row
|
|
|
+ $s.hashTable = arr; //set
|
|
|
+ $s.btnDel = {onclick: btnDel}; //update del button handlers
|
|
|
//document.onchange();
|
|
|
};
|
|
|
$s.btnDel = {onclick: btnDel};
|
|
|
|
|
|
$s.addPerson = {onclick: function(){
|
|
|
- var arr = $s.hashTable.slice();
|
|
|
- arr.push(Object.assign({},arr[0]))
|
|
|
- $s.hashTable = arr;
|
|
|
- $s.btnDel = {onclick: btnDel};
|
|
|
+ var arr = $s.hashTable.slice(); //copy
|
|
|
+ arr.push(Object.assign({},arr[0])) //add new row
|
|
|
+ $s.hashTable = arr; //set
|
|
|
+ $s.btnDel = {onclick: btnDel}; //update del button handlers
|
|
|
|
|
|
|
|
|
|