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

DataSource display previous result how to fix?

2 Answers 119 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Dimm
Top achievements
Rank 1
Dimm asked on 07 Jul 2012, 09:44 AM
When I try log into console dataSource.data() (readed from remote url json data) I have an empty result (but ajax request is complete and correct), but then I try read dataSource again, the .data() is displayed, but from previous result.
// call from detailInit grid
 function getCustomer(e){
      country = e.data.COUNTRY;
      customer.read(); //datasource
      console.log(customer.data());
}

There is examples in attachments (CodeIgniter controller and view. I also use employee firebird DB to read data)

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 12 Jul 2012, 06:26 AM
Hello Dimm,

Since an asynchronous request is used to load the data it will not be available immediately after calling the read method. You could use the DataSouce change event to get the new data after the request is completed.

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dimm
Top achievements
Rank 1
answered on 06 Aug 2012, 08:44 AM
Thanx it works!
Tags
Data Source
Asked by
Dimm
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Dimm
Top achievements
Rank 1
Share this question
or