Commit 5e04ff7b by Simon

Création du dom en Jquery du thead

parent 8cc8c8db
...@@ -21,14 +21,13 @@ ...@@ -21,14 +21,13 @@
this.getDays(); this.getDays();
this.getHours(); this.getHours();
this.createTable(); this.createTable();
}; };
this.createTable = () => { this.createTable = () => {
this.item.html(` this.item.html(`
<table> <table id="myTables">
<thead>
${this.createHeaderTable()} ${this.createHeaderTable()}
</thead>
<tbody> <tbody>
${this.createBodyTable()} ${this.createBodyTable()}
</tbody> </tbody>
...@@ -36,6 +35,7 @@ ...@@ -36,6 +35,7 @@
`); `);
}; };
/** /**
* Create table header for hours * Create table header for hours
* @returns {string} * @returns {string}
...@@ -55,6 +55,12 @@ ...@@ -55,6 +55,12 @@
return html; return html;
}; };
function createInputBox(hasTask, name, id, setDisabled) {
return "<input type='checkbox' id='" + id + "' name='" + name + "'" +
(hasTask ? " checked" : "") + (setDisabled ? " disabled" : "") + " />" +
"<label class='checkWrapper' for='" + id + "'></label>";
}
/** /**
* Create body content * Create body content
* @param index * @param index
...@@ -79,22 +85,21 @@ ...@@ -79,22 +85,21 @@
* @returns {string} * @returns {string}
*/ */
this.createHeaderTable = () => { this.createHeaderTable = () => {
let html = ` let $thead = $('<thead>');
<tr> let $tr = $('<tr>');
<th></th> let html, theadFinal;
`;
for(let index in this.hours) { for(let index in this.hours) {
html += ` //La première case est vide
<th>${this.hours[index]}</th> if (index < 1)
`; html = $tr.append('<th></th>');
html = $tr.append('<th>' + this.hours[index] + '</th>');
} }
html += ` theadFinal = $thead.append(html);
</tr>
`;
return html; return theadFinal.html();
}; };
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment