Hi I have a simple collapsible div created in js by a function like this:
function createColDiv() {
return '<div data-role="collapsibleset" data-theme="a" data-content-theme="a">' +
'<div data-role = "collapsible">' +
'<h2>Sub0001</h2>' +
'</div>' +
'</div>';
}
this is done inside another function that creates a table that appears before the collapsible div, like this:
function build() {
var windowContent = '<table id="tabellaGallery" class="ui-body-d ui-shadow ui-responsive table-stripe" data-column-btn-theme="b" style="width:100%; margin:0px; border:0px solid black; border-collapse: collapse;">' +
'<tr style="text-align: center; border-bottom: 1px solid #AFAFAF" ><td align="center" style="text-align: center; font-weight: bold" colspan="2">Table Title</td></tr>' +
'<tr class="bb" style="vertical-align: middle;min-width: 150px;padding-left:0.3em">' +
'<td style="vertical-align: middle;min-width: 150px;padding-left:0.3em">Data di nascita</td>' +
'<td align="right" style="vertical-align: middle; padding-left:0.5em;padding-right:0.4em">14091947</td>' +
'</tr>' +
'<tr class="bb" style="vertical-align: middle;min-width: 150px;padding-left:0.3em">' +
'<td style="vertical-align: middle;min-width: 150px;padding-left:0.3em">Luogo di nascita</td>' +
'<td align="right" style="vertical-align: middle; padding-left:0.5em;padding-right:0.4em">L378</td>' +
'</tr>' +
'</table>' +
createColDiv();
$('#myPage').html(windowContent);
}
Then I add all the html to the page with $('#myPage').html(windowContent);
. The problem is that the first time I enter that page I can see my collapsible div correctly like this:
but then if I enter again I see my "collapsible div" like this:
It is not even a button anymore, just plain text.. What did I do wrong?