JSFiddle - React, Tailwind, and code Playground
JavaScript
var myTree = ({
rowCount: 0,
orderDirection: "ascending",
dataType: "number",
orderColumn: "",
datasource: "online_users",
param: (void 0),
searchFields: [],
filters: [],
initCallback: (function () {
updateTotals();
}),
reloadCallback: function updateTotals() {
document.getElementById("summary_index").value = "Total: " + myTree.rowCount;
},
totals: {},
currencyMultiplier: 1,
getNode: (function (row) {
return this.nodelist[row];
}),
getValueDateTime: (function (value) {
return value ? value.substring(8, 10) + ("/" + value.substring(5, 7) + " " + value.substring(11, 16)) : "";
}),
getValue: (function (index, attr) {
return this.nodelist[index].getAttribute(attr);
}),
setValue: (function (index, attr, value) {
this.nodelist[index].setAttribute(attr, value);
this.treebox.invalidateRow(index);
}),
getCellText: (function (row, col) {
if (row >= this.rowCount) {
return "";
}
if (col.id == "index") {
return row + 1;
}
if (col.element.hasAttribute("decimal")) {
var value = parseFloat(this.getValue(row, col.id));
if (isNaN(value)) {
value = 0;
}
return (this.currencyMultiplier * value).toFixed(2).replace(".", ",");
}
if (col.element.hasAttribute("datetime")) {
return this.getValueDateTime(this.getValue(row, col.id));
}
return this.nodelist[row].hasAttribute(col.id) ? this.nodelist[row].getAttribute(col.id) : "";
}),
getCellValue: (function (index, col) {
return this.getCellText(index, col) == "YES";
}),
init: (function (reload, callback) {
if (!this.data || reload) {
var asynccallback = function (req) {
stdTree.data = req.responseXML;
if (!stdTree.data) {
...