jQWidgets Forums

jQuery UI Widgets Forums Grid Grid data adapter issue

This topic contains 7 replies, has 3 voices, and was last updated by  admin 7 years, 9 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • Grid data adapter issue #96147

    EricK
    Participant

    Hello to all.
    I am running into a small issue with adding a new record to the grid when the grid and data adapter is empty.
    After adding a record I want to access the data adapter to pull info.
    When I select the records from the data adapter is tell me it is empty.
    Please look at example I setup in jseditor
    https://www.jseditor.io/?key=grid-dataadapter-issue

    Let me know if I can access the adapter after a new row is added.

    Works fine if I fill data in the grid and then add record.

    Grid data adapter issue #96151

    Peter Stoev
    Keymaster

    Hi Erick,

    The dataAdapter’s records are used to populate the Grid. The process goes only from adapter to Grid and not from Grid to adapter. When you add records to the Grid, the access is through Grid API like “getrows” method which returns an Array of data records.

    Best Regards,
    Peter Stoev

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

    Grid data adapter issue #96154

    EricK
    Participant

    Peter

    Thank you for the clarification. I am aware of the relationship between the adapter and the grid.

    I thought this part of the code updates the data adapter and the commit applies it to the grid.

    localdata: data,
        addrow: function (rowID, rowData, position, commit) {
           commit(true,keyid);
           $('#f1').val('');
           $('#f2').val('');
        }
    

    (This only happens when the data adapter is empty, works fine if data exists in the adapter)
    The issue I am illustrating is that if you have a empty data adapter and add a record.
    I am then checking the data adapter for data. (no data)
    Example: https://www.jseditor.io/?key=grid-dataadapter-issue

    What am I missing?

    Grid data adapter issue #96171

    Peter Stoev
    Keymaster

    Hi Erick,

    No, it does not update the dataAdapter and never did.

    Best Regards,
    Peter Stoev

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

    Grid data adapter issue #96180

    EricK
    Participant

    Peter,
    We may be viewing this in two different directions.
    I am not saying the grid is updating the adapter.

    Please look a the example again. It is a very basic setup.

    Run the example.
    Select the view button which will show one record in the adapter.
    Select the add button which will add a record to the grid and adapter.
    Select the new item added to the grid.
    Select the view button again and the adapter now has 2 records.

    The example should show that the adapter is getting updated.
    Now when did the adapter add the new data record?

    Grid data adapter issue #96181

    Peter Stoev
    Keymaster

    Your example is not shared and the link is invalid. In general you should do nothing with the adapter and use only the Grid.

    Grid data adapter issue #96183

    EricK
    Participant

    Peter,
    Shared
    https://www.jseditor.io/?key=grid-dataadapter-issue

    I use php to access the database….
    So this is method I use.

    Grid data adapter issue #96209

    admin
    Keymaster

    Thanks for the feedback. With the help of the sample, we confirm the reported behavior about our Grid.

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

You must be logged in to reply to this topic.