0

I am basically building dynamic collapsible content which is called when page change is done.

The creation of the collapsable content is generated on page change and populated dynamically with a number of divs. The first collapsable section is set as open (uncollapsed)

when I go to the previous page and go go back into the dynamic collapsable content page I lose the collapsable sections formatting (css)

-- I do use $page =$(pageSelector);

Tried using - $page.page(); $.mobile.changePage($page); is breaking page back button.

malteseKnight
  • 347
  • 4
  • 12
  • what kind of divs are you using inside the collapsible content r u using grid or try using dynamic list inside the collapsable content that will make those list inside the those content inside collapsable. – Sathya Raj Dec 14 '12 at 08:05
  • $('#id').append('

    Code

    '); CSS for barcode -> .barcode .bar1 { border-left:1px solid black; }
    – malteseKnight Dec 15 '12 at 12:53

1 Answers1

0

If you are appending whole Collapsible div when you append use $("#id").append("content").trigger('create'); or you can keep the Collapsible div static and append the content like

<div data-role="collapsible" data-content-theme="c">
   <h3>Header</h3>
   <div id="content"></div>
</div>
<script>
    $("#content").append('data');
</script>

Edit:

ok i thought you were trying append content into collapsible but u were appending whole collapsible itself then u should read this documentation. As explained u have to updatelayout itself like

.trigger('updaelayout');

after appending the collapsible.

Edit 2:

<div data-role=collapsible>
   <h3>Header</h3>
    <div id="data-set" class="ui-collapsible-content ui-body-c ui-corner-bottom">
    </div>
</div>
$("#data-set").append('data');

try this.

Sathya Raj
  • 1,079
  • 2
  • 12
  • 30
  • Thanks for your reply -- this is the setup - static content:
    .This is the dynamic content: $('#id').append("

    "+data.givenName+"

    "+data.text+"
    ").trigger('create'); I also tried - $('#idContainer').trigger("create"); Still not working
    – malteseKnight Dec 15 '12 at 15:48
  • @malteseKnight coz collabsible has dynamic events in framework to hide and show contents u have to update layout itself.try the edits. – Sathya Raj Dec 17 '12 at 06:59
  • Thanks for your insights and help. Unfortunately I am still not getting lucky here. tried both trigger create and also updatelayout... – malteseKnight Dec 18 '12 at 08:40
  • @malteseKnight ok it should work fine according to the documentation , i might have way around it like you can keep the whole collapsable as static content in the document jus add the dynamic data alone in collapsable with
      add data as list specify data-inset=true for list and refresh list alone the data will be inside div this is wat i have done in my projs. I could really try if u had some jsfiddle of what u have implemented.
    – Sathya Raj Dec 30 '12 at 04:53