views:

93

answers:

0

I have a sortable list inside of a modal dialog (non jQuery UI):

<div id="modal">
    <ul id="reorderList">
        <li>Item 1</li>
        <li>Item 2</li>
        <li>Item 3</li>
        <li>Item 4</li>
        <li>Item 5</li>
    </ul><!-- /#reorderList -->

    <button class="save" type="button">Save Order</button>
    <button class="cancel" type="button">Cancel</button>
</div>

I would like to attach a click event handler to the 'Save Order' button that triggers the sortable('toArray') functionality. Likewise, I would like the 'Cancel' button to trigger sortable.('destroy') to reset the list to it's initial state.

Although I have a good handle on triggering events form within sortable's callback functions, I haven't found any information on calling methods from these external controls.