jQWidgets Forums

jQuery UI Widgets Forums TreeGrid updateBoundData and hideColumn dont work correct

This topic contains 2 replies, has 2 voices, and was last updated by  Kyvaldenius 4 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • Kyvaldenius
    Participant

    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 hidden

    it 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]);
    }
    } ………………………………


    Hristo
    Participant

    Hello Kyvaldenius,

    The time for refreshing the view is more than executing the hideColumn method.
    For this purpose, you could implement the bindingComplete event and handle there this logic with the hidden columns.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    https://www.jqwidgets.com


    Kyvaldenius
    Participant

    thank you so much. just what you need

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.