Hi,
I have a view model with two Data Sources A & B.
- Data Source A requests data from server. Data received contains multi-collections.
- One collection is returned from the "Parse" function to populate Data Source A
- Another collection is being set to a JavaScript variable to be used later on by Data Source B. Why? I couldn't access current view model to set the value of the other Data Source.
Problem now is, when the page loads, the local collection is empty and Data Source B is defined based on that local collection. By the time the data received by Data Source A, the form would have been bound to empty data.
Is there a work around in here?
signatures is a local array outside view model that is being updated by Data Source A parse function.
I have a view model with two Data Sources A & B.
- Data Source A requests data from server. Data received contains multi-collections.
- One collection is returned from the "Parse" function to populate Data Source A
- Another collection is being set to a JavaScript variable to be used later on by Data Source B. Why? I couldn't access current view model to set the value of the other Data Source.
Problem now is, when the page loads, the local collection is empty and Data Source B is defined based on that local collection. By the time the data received by Data Source A, the form would have been bound to empty data.
Is there a work around in here?
signatures is a local array outside view model that is being updated by Data Source A parse function.
signatureDatasource:
new
kendo.data.DataSource({
data:
function
() {
return
signatures },
schema: {
model: SignatureModel
}
})