It would be nice if it will be possible to bind multiple viewmodel to a single DOM container. Like xaml binding in witch you can specify a "Binding Source" adding a simple way to specify different viewmodel can help in many real situation. The solution can be accomplished very easily. If you introduce an override of kendo.bind in witch u can specify a key string for identify a viewmodel then with a data attribute or a custom binding you can filter when activate or not the bindings.
There are issues with null values not correctly binding without using a custom binder. See demo project here: http://www.kendoui.com/code-library/mvc/grid/binding-nullable-field-to-dropdownlist-editor-in-grid.aspx Forum post here: http://www.kendoui.com/forums/mvc/grid/nullable-property-in-grid-doesn't-update-(when-bound-to-combobox).aspx
Suppose a model is defined with settings for editable, required, validation, etc. Then this model is used a datasource's schema. Instances of the datasource's data will be models. However, if a model is bound to some HTML view, it's settings are not applied to the view. All settings have to be manually applied to the HTML elements. I suggest that these settings are applied automatically. Then for example, a field's property like "required" wouldn't have to be coded at two different places.
Allow to sort an ObservableArray The current work around is to use the native array function Array.prototype.sort.call(myArray, myComparer);
### Bug report
When the Kendo UI NumericTextBox widget is implemented via the MVVM pattern, the property "selectOnFocus" can't be set with the 'data' attribute.
### Reproduction of the problem
1) Create a NumericTextBox widget by using MVVM pattern;
2) Set data-selectOnFocus="true" to the input element for the NumericTextBox;
3) Enter a value in the NumericTextBox and focus it;
4) The entered value is not selected;
A Dojo sample for reproduction: https://dojo.telerik.com/aTidozIC
### Expected/desired behavior
When the Kendo UI NmericTextBox with MVVM is configured with option data-selectOnFocus="true", the entered value should be selected, once the input element is focused.
### Environment
* **Kendo UI version:**2021.1.224
* **jQuery version:** 1.12.4
* **Browser:** [all]
It would be exponentially helpful if the "ObservableArray" implemented some basic "Where/Select/Single" methods. This would assist in searching through them and give Kendo UI a much needed facelift in the array department. Behavior would be, theoretically, as follows... var viewModel = kendo.observable({ Users: [ { id: 1, name: "Stacey" }, { id: 2, name: "Dylan" }, { id: 3, name: "John" } ] }); var idSearch = 1; var result = kendo.Search(viewModelArray).Where(function(x) { return x.id == idSearch }); or ... var result = kendo.Search(viewModelArray) .Single(function(x) { return x.id == idSearch }); or possibly even chained like in "linqjs" var result = kendo.Search(viewModelArray) .Where(function(x) { return x.id == idSearch }) .Single();
I am using DropDownList in MVVM scenario. Currently, the MVVM supports only external templates. If I try to use the inline template with a simple string in no-data-template it is rendered as expected. However, if there is a special symbol in the template a JavaScript error will be thrown. For example, the following noDataTemplate is throwing an error:
data-no-data-template="some text ."
I would like to have the possibility to use inline templates with special symbols in MVVM scenarios.
Workaround:
I would suggest using a Regex in the parseOptions function in kendo.all.js as demonstrated below:
if (typeof value === 'string') {
var rxIDtest = /^[A-Za-z0-9.:_]/g
if (rxIDtest.test(value) === false && $('#' + value).length) {
value = kendo.template($('#' + value).html());
} else if (source) {
value = kendo.template(source[value]);
}
} else {
value = element.getAttribute(option);
}
Currently radio buttons can only bind to a string. They need to bind to a boolean value so we can have clean models, otherwise we have to put in ugly functions to convert the string to a boolean within the model.
Hi Andrew, Can you give me a scenario where a writable computed observable would be required? As the KO site states, these are very uncommon, mainly because the computed nature of the observable makes them unnecessary. If you need an update, set one or more of the dependent observables, and the computer observable also reflects the change.
Current way of implementing functions in viewmodels suck because you have to use this.get and this.set to access the viewmodel properties. The syntax would be much prettier if you can use advantage of TypeScript strong typing.
It would be nice to have some additional "flow control" for the MVVM framework, including ... "if" - <div data-bind="if: [property]"> // renders if the given value is true </div> and "not" <div data-bind="not: enabled"> // renders if the given value is false </div> and "each" <div data-bind="each: array"> // renders this section for each item in the array given </div> I know some of this can be achieved with templates, but this would make it very convenient and mean we did not have to use templates everywhere, and could lead to much more natural coding.
MVVM is still lacking some of the capability that is provided by the standard widgets. For example a tooltip cannot bind it's content property to a function in a viewmodel.