From 43fa5056342b736c66c89206703894b52dc8fe31 Mon Sep 17 00:00:00 2001 From: tohe Date: Fri, 18 Sep 2020 14:01:42 +0000 Subject: [PATCH] Removed backup file --- kaform.js.bak | 225 -------------------------------------------------- 1 file changed, 225 deletions(-) delete mode 100644 kaform.js.bak diff --git a/kaform.js.bak b/kaform.js.bak deleted file mode 100644 index 3edb666..0000000 --- a/kaform.js.bak +++ /dev/null @@ -1,225 +0,0 @@ - -var nextRowId=1; - -function renumberTableRows(){ - var row_no=1; - var table = document.getElementById("tabbody"); - for (var i = 0, row; row = table.rows[i]; i++) { - row.cells[0].innerHTML=row_no++; - } -} - -function deleteTableRow(rowId){ - var target = document.getElementById("upload-target"+rowId); - var children = target.children; - - // delete all uploaded elements - for (var i = 0; i < children.length; i++) { - var tmp = children[i].getAttribute("data-id"); - $K.ajax.post({ - url: 'delete.php', - data: 'id='+tmp, - before: function(xhr) {}, - success: function(response) {}, - error: function(response) {} - }); - } - - - // delete the row from table - var element = document.getElementById("trow"+rowId); - element.parentNode.removeChild(element); - renumberTableRows(); -// alert(rowId); - -} - -function addTableRow(){ - - var $node = $K.dom('#tabbody'); - // create a new table row with id - var element = document.createElement('tr'); - element.setAttribute("id", "trow"+nextRowId); - - var e=""; - - // add column for position no - e += ''; - - // add coluemn for description - e += ` `; - - // add column for date - e += ``; - - // add column for num - e += ``; - - // add column for file upload - e+= ` - -
-
-
-
-
-
-
- - - `; - // add delete bnutton - e += - ` - `; - - - $node.append(element); - element.innerHTML=(e); - renumberTableRows(); - nextRowId++; -} - - -function submitTable(){ - alert("submit"); - - var obj; - - var table = document.getElementById("tabbody"); - for (var i = 0, row; row = table.rows[i]; i++) { - console.log(row.cells[1]); -// var n = row.cells[1].value; -// alert(n); - } - - - -} - - -$K.add('module','kaform', { - init: function(app,context){ - this.app = app; - - // getting context and the module element - this.context = context; - this.$element = context.getElement(); - }, - - hello: function(){ - alert ("hello function of kaform"); - }, - - start: function() - { - - /*this.$element.on('keydown.kube.editable', this._hui.bind(this)); - this.$element.on('paste.kube.editable', this._hui.bind(this)); - this.$element.on('blur.kube.editable', this._hui.bind(this)); - */ - -// alert(this.$element); -// this.$element.on('click', this.addRow.bind(this)); - this._build(); - }, - - addRow: function() - { - - var $node = $K.dom('#tabbody'); - // create a new table row with id - var element = document.createElement('tr'); - element.setAttribute("id", "trow"+nextRowId); - - var e=""; - - // add column for position no - e += ''; - - // add coluemn for description - e += ' '; - - // add column for date - e += ''; - - // add column for num - e += ''; - - // add column for file upload - - e+= ` - -
-
-
-
-
-
-
- - - `; - // add delete bnutton - e += - ` - `; - - $node.append(element); - element.innerHTML=(e); - renumberTableRows(); - nextRowId++; - - - }, - - // private - _build: function() - { - - }, - onmessage: { - alert: { - closed: function(sender) - { - alert(sender); - // caught - } - } - } -}); - - -// startup is here - -$K.init({ - observer: true -}); - - -// on startup clear session on server -$K.ajax.get({ - url: 'clear.php', - data: '', // or key=value object - before: function(xhr) {}, - success: function(response) {}, - error: function(response) {} -}); - -// add on table row -addTableRow();