mirror of https://github.com/zlatinb/muwire
add ability to set css class to sortable tables. Make certificates table certificates class
parent
f0ffc68122
commit
5788329e1a
|
@ -98,6 +98,7 @@ class CertificateResponse {
|
|||
else if (params.order == "ascending")
|
||||
newOrder = "descending"
|
||||
var table = new Table(["Issuer", "Name", "Timestamp", "Import"], "sort", params.key, newOrder, this.divId)
|
||||
table.setCSSClass("certificates")
|
||||
|
||||
var i
|
||||
for (i = 0; i < this.certificates.length; i++) {
|
||||
|
|
|
@ -39,14 +39,23 @@ class Table {
|
|||
this.rows = []
|
||||
this.key = key
|
||||
this.descending = descending
|
||||
this.cssClass = null
|
||||
}
|
||||
|
||||
addRow(mapping) {
|
||||
this.rows.push(mapping)
|
||||
}
|
||||
|
||||
setCSSClass(cssClass) {
|
||||
this.cssClass = cssClass
|
||||
}
|
||||
|
||||
render() {
|
||||
var html = "<table><thead><tr>"
|
||||
var html = "<table>"
|
||||
if (this.cssClass != null) {
|
||||
html = "<table class='" + this.cssClass + "'>"
|
||||
}
|
||||
html += "<thead><tr>"
|
||||
var i
|
||||
for (i = 0;i < this.columns.length; i++) {
|
||||
if (this.columns[i].key == this.key)
|
||||
|
|
Loading…
Reference in New Issue