jQWidgets Forums
jQuery UI Widgets › Forums › TreeGrid › updateBoundData and hideColumn dont work correct
Tagged: hidecolumn, updatebounddata
This topic contains 2 replies, has 2 voices, and was last updated by Kyvaldenius 4 years, 1 month ago.
-
Author
-
Good day. Faced a problem with updating jqxtreegrid
“$ (” # treegrid “). jqxTreeGrid (‘updateBoundData’ ‘);”After adding a row to the database, I want to update the grid (taking into account the fact that auxiliary columns will be hidden)
I found an example on your forum$ (“# treegrid”). jqxTreeGrid (‘updateBoundData’);
for (var i = 0; i <hiddenColumns.length; i ++) {
$ (“# treeGrid”). jqxTreeGrid (‘hideColumn’, hiddenColumns [i]);
}
hiddenColumns – array with the names of the columns to be hiddenit turns out that while “updateBoundData” is being executed, “hideColumn” has time to complete and the columns are not hidden
how can i fix this?
if I make a button that hides the columns then everything works
(“updateBoundData” manages to fire after which I already click on the button)but I don’t want to press the “hide columns” button every time
example in code
$ .ajax ({
beforeSend: function () {
$ (‘# loader’). jqxLoader (‘open’);
},
type: ‘POST’,
url: ‘/ ControllerMy/ ControllerMyCRUD /’,
contentType: ‘application / json’,
data: JSON.stringify (data),
success: function (result) {
var id;
if (id = parseInt (result)) {
if (id> 0) {
$ (‘# message’). html (‘<h3> Record added! </h3>’);
}
else {
$ (‘# message’). html (‘<h3> No entry added! </h3> <h3> This entry already exists <h3 />’);
}
alert (“updateBoundData”);
$ (“# treegrid”). jqxTreeGrid (‘updateBoundData’);
for (var i = 0; i <hiddenColumns.length; i ++) {
$ (“# treeGrid”). jqxTreeGrid (‘hideColumn’, hiddenColumns [i]);
}
} ………………………………Hello Kyvaldenius,
The time for refreshing the view is more than executing the
hideColumn
method.
For this purpose, you could implement thebindingComplete
event and handle there this logic with the hidden columns.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comthank you so much. just what you need
-
AuthorPosts
You must be logged in to reply to this topic.