DataSource display previous result how to fix?

3 posts, 0 answers
  1. Dimm
    Dimm avatar
    4 posts
    Member since:
    May 2012

    Posted 07 Jul 2012 Link to this post

    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. Daniel
    Admin
    Daniel avatar
    2230 posts

    Posted 12 Jul 2012 Link to this post

    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!
  3. Dimm
    Dimm avatar
    4 posts
    Member since:
    May 2012

    Posted 06 Aug 2012 Link to this post

    Thanx it works!
Back to Top