|
@@ -55,19 +55,25 @@ 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;
|
|
|
- thisLine.remove();
|
|
|
- $s["#hashTable tr:first-child button"] = false; //turn off first button of deletion
|
|
|
+ arr.splice(thisLine.rowIndex,1)
|
|
|
+ $s.hashTable = arr;
|
|
|
document.onchange();
|
|
|
};
|
|
|
$s.btnDel = {onclick: btnDel};
|
|
|
|
|
|
$s.addPerson = {onclick: function(){
|
|
|
- var newLine = document.getElementById('hashTable').copy.children[0].cloneNode(true);
|
|
|
- newLine.nbData = Object.assign({},persons[0]);
|
|
|
- document.getElementById('hashTable').appendChild(newLine);
|
|
|
- $s.btnDel = {onclick: btnDel};
|
|
|
- document.onchange();
|
|
|
+ var arr = $s.hashTable.slice();
|
|
|
+ arr.push(Object.assing({},arr[0]))
|
|
|
+ $s.hashTable = arr;
|
|
|
+
|
|
|
+
|
|
|
+ //var newLine = document.getElementById('hashTable').copy.children[0].cloneNode(true);
|
|
|
+ //newLine.nbData = Object.assign({},persons[0]);
|
|
|
+ //document.getElementById('hashTable').appendChild(newLine);
|
|
|
+ //$s.btnDel = {onclick: btnDel};
|
|
|
+ //document.onchange();
|
|
|
}}
|
|
|
|
|
|
var ediNumbers = [];
|