So for DatePicker and NumericTextBox, when a value is already present, selecting the text in the control thru the UI and deleting it, does not update the underlying datasource. Thru inspection and walking code, I can see that the controls do indeed have their value set to NULL, so it appears to be in the observer and not the controls.
Anyone else unable to delete values successfully or is this just me??
Thanks!
Mike
11 Answers, 1 is accepted
The repro case is pretty quick and straight-forward too, so I can't see it being anything I am doing.
1) Create a simple model with a date or numeric property and have it set to some value; use the kendo.observable wrapper around the model object.
2) Add an input control.
3) Add the data-binding attributes, binding 'value' to your model property.
4) Configure the input as either a Kendo DatePicker or NumericTextBox.
5) Call the MVVM bind and pass in your simple model.
6) Now select and delete the value in the box.
7) Check your model and see that it still has the same value as before.
(I used both the blur and change events to confirm as well checking much later on too, just to make sure not a timing issue. Also, change the value to another value and see that your model is verified to update as expected using the same events.)
Any validation by someone would be cool. Thanks!
Mike
I'm afraid that I'm unable to observed such behavior using the provided information. Please take a look at the following jsFiddle test page, maybe I'm missing something obvious:
Rosen
the Telerik team
Thanks for checking into this! Stand by...
Mike
For example, a binder object of ClientBinder has a property ClientBinder.MainModel that contains the observable model. And the input bindings would be as such: data-bind="value: MainModel.TotalNetWorth" and the binding call would be kendo.bind($('form'), ClientBinder). The reason for this composite object is I have another view model off the same ClientBinder object, for other binding concerns, and I bind it all up in one call.
That all works except in the scenario I originally described. I have updated the jsFiddle example that demonstrates the exact issue for both numeric and date types: http://jsfiddle.net/wBNZR/21/
Please advise- thanks!
Mike
Thank you for the test page. The issue you are facing is caused by the fact that at the point at which the View is bind to the ViewModel, the ClientBinder is converted to a ObservableObject. However, in the official release the inner ObservableObjects will be converted once again. This in your case will result in two separate instances of MainModel, thus the code in click handlers is pointing to the old instance which is not actually bound to the View. However, this has been already addressed and you may try the latest internal build to see if there is change in the observed behavior.
Regards,Rosen
the Telerik team
The issue is specifically only with blanks (nulls) and nothing else. Does this still fit with your description of the problem?
Thanks,
Mike
Anyway, please advise because I don't think you were describing the same behavior and regardless, it is not addressed in the internal build for either the DatePicker or NumericTextBox.
Thanks,
Mike
Indeed, you are correct the latest internal build does not include the fix for the issue you have described. However, it will be available with the next internal build.
Regards,Rosen
the Telerik team
Thanks,
Mike
Please advise. Alternately, a workaround in the meantime would be nice too.
Thanks,
Mike
I'm afraid that the 503 (May 3rd) release does not contain the fix in question as it is older than my previous post. Newer internal build will be available most probably within a week.
Also please note that internal builds are not suitable to be used in production environment but only for testing/development as they did not went through complete QA process.
Rosen
the Telerik team