Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Initialising Everlive DataSource

$
0
0

I have finally found a good solution. Posting here for the benefit of others.

My code has evolved a bit but basically the key is that I need to call fetch() in order to ensure that the datasouce has the data before calling get().

if(e.view.params.companyID) {
    varitem = e.view.params.companyID;
    source.fetch(function() {
        varitemModel = source.get(item);
        viewModel.set('currentItem', itemModel);
    });
} else{
    varitem = e.view.params.uid;
    varitemModel = source.getByUid(item);
    viewModel.set('currentItem', itemModel);
}

 


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>