This is a migrated thread and some comments may be shown as answers.

New item not returned by read() using Internet Explorer

2 Answers 88 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Cory Deppen
Top achievements
Rank 1
Cory Deppen asked on 26 Dec 2011, 06:07 PM
I've noticed that while adding an item to the data source then calling sync() creates the item and read() successfully returns the expected rows in Chrome and Firefox, this doesn't appear to be the case in Internet Explorer. I can see the POST is successful and returns the new item via JSON. The item appears in the grid briefly, until read() is called. The GET caused by the read() method doesn't include the newly added item in the response. When I refresh the page, the new item is there.

I originally had the same problem as noted in this thread, but I've since set cache to false in the read function but still have the issue of new items not appearing in the results only when using IE.

2 Answers, 1 is accepted

Sort by
0
Cory Deppen
Top achievements
Rank 1
answered on 26 Dec 2011, 10:51 PM
After reading this post again, I realized it might be possible to pass jQuery.ajax settings to the create option of the data source. At first, I tried passing "async: false", which seemed to allow the read() to only happen once the sync was done. I wasn't sure if this was the best/proper way, so I tried passing the success option with a callback that called read() on the data source, but it didn't appear to be called. The complete option was called, though, and the callback returned the data as expected once the create was done. I felt a little better about this approach because it meant I only needed to call sync() from the click event and the read() would just happen once the create was done.

I would still be interested to know if this is an acceptable approach or if there are better ways. I'd also like to know if the success option should actually be able to be called or not.
0
Joel
Top achievements
Rank 1
answered on 27 Dec 2011, 06:31 AM
Deleted as the bug was my own fault. I was setting the cache to false on the transport object instead of the read one.
Tags
Data Source
Asked by
Cory Deppen
Top achievements
Rank 1
Answers by
Cory Deppen
Top achievements
Rank 1
Joel
Top achievements
Rank 1
Share this question
or