Commit 5e04ff7b by Simon

Création du dom en Jquery du thead

parent 8cc8c8db
......@@ -21,14 +21,13 @@
this.getDays();
this.getHours();
this.createTable();
};
this.createTable = () => {
this.item.html(`
<table>
<thead>
<table id="myTables">
${this.createHeaderTable()}
</thead>
<tbody>
${this.createBodyTable()}
</tbody>
......@@ -36,6 +35,7 @@
`);
};
/**
* Create table header for hours
* @returns {string}
......@@ -55,6 +55,12 @@
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
* @param index
......@@ -79,22 +85,21 @@
* @returns {string}
*/
this.createHeaderTable = () => {
let html = `
<tr>
<th></th>
`;
let $thead = $('<thead>');
let $tr = $('<tr>');
let html, theadFinal;
for(let index in this.hours) {
html += `
<th>${this.hours[index]}</th>
`;
//La première case est vide
if (index < 1)
html = $tr.append('<th></th>');
html = $tr.append('<th>' + this.hours[index] + '</th>');
}
html += `
</tr>
`;
theadFinal = $thead.append(html);
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