How to expand and collapse all accoutns using Jquery..
- by kumar
Here is my code to expand and collapse all the users on the grid..
But problem is without clicking expand buttong if I open any user..its opening fyn,,
but if I click again on the expand button happening the opened subgrid is closing and closing one is opening...
here is my code can anybody tell me what's the wrong with this.
<script type="text/javascript">
$(document).ready(function() {
$('#tmpOpen').click(function() {
var value = document.getElementById("tmpOpen").value;
if (value == "Expand All Accounts") {
document.getElementById("tmpOpen").value = "Collapse";
loadAll();
}
else {
document.getElementById("tmpOpen").value = "Expand";
loadAll();
}
});
function loadAll() {
var o = true;
$('#Grid1 tr[role="row"] td a').each(function(row) {
if (o) {
$(this).trigger('click');
}
});
}
});
</script>