0

i have to implement jquery ui accordion and sortable in asp.net mvc dynamically generated table rows. i have implemented sortable and its working fine but how can i impelement accordion to table tbody.

        <table >    
    <tbody id="rowAccordion">
            @foreach (var item in Model)
            {
                <tr class="rowSort">
                    <td style="width: 200px;">
                        <h3>
                            <a href="#">@item.PageTitle</a>
                        </h3>
                        <div>
                            <p>
                                Discription
                            </p>
                        </div>
                    </td>
                </tr>
            }  
</tbody> 
</table>

<script>
    $(function () { $("#rowAccordion").accordion(); }); 

    $("#rowAccordion").sortable();
</script>
1
  • Did you have success? Commented Nov 17, 2015 at 20:50

1 Answer 1

1

Use the option "header" using the column that you want to appear as the header.

$(document).ready(function () {
    $("#rowAccordion").accordion({header: 'YOUR COLUMN SELECTOR HERE' });
});

hth

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.