Hello,
All the samples on MVVM show that, we fetch a datasource assign it to select list. The selected object in select list is then bound to view model.
e.g. in viewmodel we initailly set selectedProduct = null
the controls are then bound as
<label>UnitPrice</label> <input type="text" data-role="numerictextbox" data-bind="value: selectedProduct.UnitPrice, events: { change: change }" />
Note the value field, it is bound to selectedProduct
Now, i dont have a dropdown on my form, i want to fetch data from server on readrequest and directly bind that to all controls.
So my transport has read method but i dont have a selectedProduct. I want to assign values from read transport directly to controls.
Is there a way to do this?
Please let me know if this is not clear, i'll attach code blocks.
Thanks,
Sushant
All the samples on MVVM show that, we fetch a datasource assign it to select list. The selected object in select list is then bound to view model.
e.g. in viewmodel we initailly set selectedProduct = null
the controls are then bound as
<label>UnitPrice</label> <input type="text" data-role="numerictextbox" data-bind="value: selectedProduct.UnitPrice, events: { change: change }" />
Note the value field, it is bound to selectedProduct
Now, i dont have a dropdown on my form, i want to fetch data from server on readrequest and directly bind that to all controls.
So my transport has read method but i dont have a selectedProduct. I want to assign values from read transport directly to controls.
Is there a way to do this?
Please let me know if this is not clear, i'll attach code blocks.
Thanks,
Sushant