3

I'm pretty disappointed with the kendo dropdown and combobox and it's functionality in general and angular in specific:

  1. The documentation is pretty terrible for angular and things like how to properly put ValueMapper settings inline. I've hacked it, but it isn't working right from what I can tell.

Basically I set the combo like this:

                            <select kendo-combo-box
                                    k-data-text-field="'Name'"
                                    k-data-value-field="'Id'"
                                    k-min-length="3"
                                    k-suggest="true"
                                    k-highlight-first="true"
                                    k-auto-bind="false"
                                    k-filter="'startswith'"
                                    k-ignore-case="true"
                                    k-placeholder="'Select User'"
                                    k-virtual="vm.UserValueMapper"
                                    k-data-source="vm.UserDataSource[$index]"
                                    k-ng-model="Assignee.UserId"
                                    style="width: 100%"></select>

where vm.UserValueMapper is like this: (Typescript)

        public UserValueMapper: kendo.ui.ComboBoxVirtual = {
            valueMapper: (options) => {
                var self = this;
                self.usersApi.Get(options.value).then((user) => {
                    options.success(user);
                });
            }
        }

which gets executed only when the user clicks on the drop down of the control and options.value is null.

It doesn't ever get called when ng-model sets the value (or k-ng-model) which makes for an empty combo box even when there is a value that should have been filled in.

Either I'm doing the configuration wrong or this functionality is just broken in the latest version of Kendo. (or this is a feature that the end user would want to see an empty name.. just like #2 is claimed to be...)

  1. If you set data-value-field it doesn't actually use this value to send back to ng-model (or k-ng-model), it sends back the entire selected object which is just silly. There isn't one case where this is what a user would want and even if they did, they would simply set data-value-field = null and it should return that. Why this hasn't been once and for all fixed I'm not sure, but it's an embarrassment that it was ever written this way and has been known for YEARS and nothing done.

Does anyone have any workarounds for #1 and making that work properly?

James Hancock
  • 3,348
  • 5
  • 34
  • 59

0 Answers0