jQWidgets Forums
jQuery UI Widgets › Forums › TreeGrid › expand all on custom row button
This topic contains 1 reply, has 2 voices, and was last updated by Hristo 6 years, 4 months ago.
-
Author
-
Hi
I have been able to invoke a JSON update on a inline row button. The database is successfully updated and the $(“#treeGrid”).jqxTreeGrid(“updateBoundData”); call reloads the treeGrid successfully. The treeGrid is collapsed and I am trying to invoke the $(“#treeGrid”).jqxTreeGrid(‘expandAll’); but it dows not work. Please can you have a look to see what I am doing wrong?
rendered: function () {
if ($(“.editButtons”).length > 0) {var editClick = function (event) {
var target = $(event.target);
// get button’s value.
var value = target.val();
// get clicked row.
var rowKey = event.target.getAttribute(‘data-row’);$.ajax(
{
//removed data but works
}
});
$(“#treeGrid”).jqxTreeGrid(“updateBoundData”); <— works correctly
$(“#treeGrid”).jqxTreeGrid(‘expandAll’); <—- This does not expand the treeGrid
}$(“.editButtons”).on(‘click’, function (event) {
editClick(event);
});
}
},
ready: function () {
initialized = true;
$(“#treeGrid”).jqxTreeGrid(‘expandAll’);
},
columns: [
{
text: ‘Actions’, dataField: ‘IsActive’, cellsAlign: ‘center’, align: “center”, filterable: false, columnType: ‘none’, width: ‘100’, editable: false, sortable: false, cellsRenderer: function (row, column, value) {
var infoURL = ‘@Url.Action(“DealershipDetails”, “Dealership”, new { id = “__id__” })’;
var editURL = ‘@Url.Action(“EditDealership”, “Dealership”, new { id = “__id__” })’;var checkbox;
if (value === true) {
checkbox = “<button data-row='” + row + “‘ class=’editButtons’ >Activate</button>”;
} else {
checkbox = “<button data-row='” + row + “‘ class=’editButtons activeButtons1’ >Disable</button>”;
}
return checkbox;
}
}
]
});Hello gjlabus,
Try to set the “expandAll” method in the
setTimeout
because it is executed immediately after the “updateBoundData”.
I hope this will help.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.