Can somebody help me in implementing Expand/Collapse functionality?
On clicking the Expand button, I need to get related data for that corresponding record and display it as a child row.
grid.Column(header: "Expand",
format: @<text>
<a href='#' class="expandable-open-button" rel="1" >></a>
<div class="expandable-child-row"></div>
</text>)
I am thinking of using jQuery. On click of ‘Expand’ link can we get the data from the database and set the webgrid html to element.
Using JQuery
nextto select the “child” element (actually a sibling); andslideToggleto expand the element:Edit You can pass the item ID by adding it to the markup as a data attribute.
Then retrieve it using
attrin JQuery: