jQuery UI Widgets Forums Grid Difference between 'refreshdata' and 'updatebounddata'?

This topic contains 16 replies, has 8 voices, and was last updated by  chrispin 2 years, 9 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author

  • codest
    Participant

    What is the difference between ‘refreshdata’ and ‘updatebounddata’ methods? From what I see, they both simply refresh the grid with the data from the source.

    What I am looking for is two-way binding: when I call ‘addrow’, ‘updaterow’ or ‘deleterow’ methods, I want my data source (an array of JSON objects in my case) to be updated automatically.

    Thank you!


    Peter Stoev
    Keymaster

    Hello odest,

    It’s explained in the documentation of jqxGrid.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    codest
    Participant

    Peter,

    Sorry, but the explanations provided in the documentation are insufficient:

    refreshdata – refreshes the data.
    updatebounddata – updates the bound data and refreshes the grid.

    The above makes very little sense to me. Could you, please, explain these two methods in detail?

    Thank you!


    Peter Stoev
    Keymaster

    Hello codest,

    updatebounddata rebinds the Grid. refreshdata does not.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    codest
    Participant

    Peter,

    It is still not clear to me what you mean by that. If you’re not sure, could you get someone else to answer this question, please?

    Thank you.


    Peter Stoev
    Keymaster

    Hi codest,

    I am pretty sure and I wrote you what’s the difference. The “updatebounddata” rebinds the Grid, “refreshdata” does not. Sorry, but I think that there’s nobody who is more experienced than me to answer a question about jqxGrid wordwide. May be the fact that I am part of the team that created this widget and I have answered 10000+ questions about it, should be taken into account.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    codest
    Participant

    Peter,

    Sorry, you did not answer my question. Instead, you provided a curt and arrogant response that benefited no one, even you.

    The API documentation for jQWidgets is rather poorly written, and a lot of things are missing or not explained well. That leaves users to finding answers by themselves, by hunting crumbs of information here and there and trying to make some sense of what they find. I would like to see the documentation being updated and taken to a next level, but it looks like it is not happening. So, the forum is the next place to look, but even here I am getting nowhere ultimately.

    Regards.


    Peter Stoev
    Keymaster

    Thank you for your feedback! I answered your question 2 times – “updatebounddata” rebinds the Grid, “refreshdata” does not. There is no more information which can be provided about these.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    dafriend
    Participant

    Peter,
    I too am not clear about the differences.

    To me data binding is making a connection between data and the user interface where changes on either side (UI or data) will be reflected in the other. So what does re-binding mean? Is the data read from the source again? Or is it only a re-mapping of the relationship between data fields and UI elements? Is it both? Is it none of the above? What exactly do you mean by “binding”?

    Some additional details and defining of terms might go a long way toward providing a clear understanding of what these functions do and how it is accomplished.

    Refreshdata might be one part of a rebinding operation – or it might not. It’s not clear what is going on.


    heer
    Participant

    Bump, Peter!

    I would also like a better description of the differences between refreshdata and updatebounddata.

    What does bound actually stand for in this case?

    Kind regards
    // Henrik


    Peter Stoev
    Keymaster

    Hi heer,

    There is nothing more that can be added. If you need to update the data-binding, use updatebounddata. To simply refresh the grid, refreshdata is enough. In 99% of the use-cases updatebounddata is used.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    jcansell
    Participant

    also bump peter !

    if we’re here, then we’re not understanding the documentation.

    I’m here because i want to re-point a jqxDataTable (not grid) from one url json data source to another and refresh the displayed results.

    $(“#dataTable”).jqxDataTable(‘updateBoundData’); is not producing any change (the same data is loading).
    do i need to create 2 dataAdapters – or am i missing something ?

    enjoying the product 🙂
    jonathan


    Peter Stoev
    Keymaster

    There are many reason why someone can write in a Forum, Jonathan. updatebounddata uses the same data source. If you want to have a new source, then set the source property to a new adapter.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    pablodg
    Participant

    Peter, a person cannot be good at everything. You may be good at coding, but for writing… you have to define concepts using different words than the concept itself.

    ‘Updatebound rebinds’ does not tell much. Reading this topic, it became clear to me that even if you coded the component, there are many many people more adequate than you for a clear answer. Probably any student for journalism, literature or related can do better. Actually, in my experience, being the author puts you in the worst position to imagine how a developer see, use or understand you components and words. You are the best for bug fixing, but maybe too far from user perspective.

    The samples of the components (and the components) are magnificent. The documentation is not as good, and I agree that if we are here, we’re not understanding the documentation.

    About this thread, if you have to change ‘source’ instead of calling updatebounddata (when modified the url), the whole thing is confusing. Actually, the whole ‘adapter’, ‘source’, and ‘source.data’ is tricky. Maybe different having adapter classes, like JsonAdater, ArrayAdaper, etc. (with properties, but not source) for each adapter strategy would be clearer.

    By the way, it would be nice if you could tell what refresh does, if updatebounddata internally calls refresh, and what rebind means in the context of your component. In my case, I update the data of an array and the rows do not show no matter I do updatebounddata or refreshbounddata.


    Peter Stoev
    Keymaster

    Hi pablodg,

    I am sorry, that you find that our documentation is not as good as other parts of our product.

    To summary the things in the end of 2018.

    1. I suggest you to set the Grid’s source property to a new dataAdapter instance. By doing that, you have new data and the Grid is re-rendered.

    2. The updatebounddata method does the same. It uses the Grid’s dataAdapter and makes dataAdapter.dataBind(). It also tries to be smart enough and re-render only some parts of the Grid. Ex: https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/refreshdata.htm?material

    3. refreshdata only re-renders the Grid. It does not make dataBind call. In general, I don’t know in which app scenario you will need to forcefully re-render the Grid, but you have the API for that if you need it.

    4. I am not aware of a method called refreshbounddata. You probably meant refreshdata.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.