jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Grid data adapter issue
Tagged: #jqwidgets-grid, grid, javascript grid, jquery grid
This topic contains 7 replies, has 3 voices, and was last updated by admin 7 years, 9 months ago.
-
AuthorGrid data adapter issue Posts
-
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-issueLet 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.
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 StoevjQWidgets Team
https://www.jqwidgets.com/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-issueWhat am I missing?
Hi Erick,
No, it does not update the dataAdapter and never did.
Best Regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com/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?Your example is not shared and the link is invalid. In general you should do nothing with the adapter and use only the Grid.
Peter,
Shared
https://www.jseditor.io/?key=grid-dataadapter-issueI use php to access the database….
So this is method I use.Thanks for the feedback. With the help of the sample, we confirm the reported behavior about our Grid.
-
AuthorPosts
You must be logged in to reply to this topic.