Hi,
I made two tables.
first one is called automatically.
second one is called when I click first one’s cell.
I WANT TO UPDATE data “second” table cell only.
The afterChange is not working second one only. but both.
(alert when I first one clicked, alert when I second one changed.)
How can I update data(sql) specific table’s cell?
(col 3 of second one’s)
I appreciate If you show me examples.
thanks.
window.onload = function() {
XMLHttpRequest1();
}
XMLHttpRequest1() {
…
var result = JSON.parse(xhttp.responseText);
HOT1(result, “first”);
}
XMLHttpRequest2() {
…
var result = JSON.parse(xhttp.responseText);
HOT2(result, “second”);
}
HOT1(data, order){
…
afterOnCellMouseDown: function(event, coords, TD) {
if (order == “first”)
XMLHttpRequest2();
},
cells: function(row, col, prop) {
var cellProperties = {};
if (order == "first") { cellProperties.readOnly = "true"; } return cellProperties; }
}
HOT2(data, order){
…
afterChange: function () {
if (order == “second”) alert(order); // alert when I first one clicked, alert when I second one changed… Why alert when first one clicked? I choose wrong function(afterChange)? I want alert when second one changed only!!!
// alert(“order”);
},
cells: function(row, col, prop) {
var cellProperties = {};
if (order== "first") { cellProperties.readOnly = "true"; } if (order== "second") { if (col == 0 || col == 1 || col == 2) cellProperties.readOnly = "true"; } return cellProperties; }
}