0

I just want to change the position of collapsible col2 before collapsiblecol1. Finally the order should be: 1.col2 2.col1 3.col3

<div data-role="content">
    <div id="List" data-role="collapsible-set">
        <div data-role="collapsible" data-content-theme="c" id="col1">
            <h3>Header 1</h3>
            <p>Text 1</p>
        </div>
        <div data-role="collapsible" data-content-theme="c" id="col2">
            <h3>Header 2</h3>    
            <p>Text 2</p>
        </div>
        <div data-role="collapsible" data-content-theme="c" id="col3">
            <h3>Header 3</h3>    
            <p>Text 3</p>
        </div>
    </div>
</div>
BobTale
  • 38
  • 4
  • You should tell in your question what have you tried so far. I think you could use this to move and then refresh the collapsible $('#col1').after($('#col2')); $('#List').collapsible('refresh') – sergioFC Oct 23 '14 at 09:54
  • @sergioFC post an answer, get some rep. – Omar Oct 23 '14 at 13:11

1 Answers1

1

You should move the collapsible and then call refresh:

$('#col1').after($('#col2')); // Move the node
$('#List').collapsibleset('refresh'); // Refresh the collapsible set

Edited: the 'refresh' method should be called in the collapsibleset plugin (not on the collapsible plugin). -Thanks Omar for the correction.

sergioFC
  • 5,926
  • 3
  • 40
  • 54