Hi.
With jQuery 2.x this funstion worked for the deferred value binding.
01.function createComboBoxBinder() {02. // taken from the Telerik UI 4 MVC examples04. kendo.data.binders.widget.deferredValue = kendo.data.Binder.extend({05. init: function (widget, bindings, options) {06. kendo.data.Binder.fn.init.call(this, widget.element[0], bindings, options);07. this.widget = widget;08. this._change = $.proxy(this.change, this);09. this.widget.bind("change", this._change);10. },11. refresh: function () {12. var widget = this.widget;13. var binding = this.bindings.deferredValue;14. var value = binding.get();15. 16. if (!this._initChange) {17. if (value) {18. if (widget.options.autoBind === false) {19. //Bind the widget with single item if deferred binding is used20. widget.dataSource.data([value]);21. widget.value(value[widget.options.dataValueField]);22. } else {23. //set widget value directly24. this.widget.value(value[widget.options.dataValueField]);25. }26. }27. } else {28. // set the data source value to show the selected value in the grid row29. binding.source.Language = value[widget.options.dataValueField];30. }31. },32. change: function () {33. this._initChange = true;34. this.bindings.deferredValue.set(this.widget.dataItem());35. this._initChange = false;36. },37. destroy: function () {38. this.widget.unbind("change", this._change);39. }40.});This is the combo box within a grid popup editor cshtml.
01.<div class="k-edit-field">02. @(Html.Kendo().ComboBox()03. .Name(componentName: "LangSelector")04. //use the data-skip attribute to prevent adding the default value binding and add the data-bind attribute for the custom binder05. .HtmlAttributes(new { data_skip = "true", data_bind = "deferredValue: LanguageItem" })06. .DataTextField(field: "Name")07. .DataValueField(field: "Id")08. .MinLength(length: 3)09. .Enable(value: false)10. .AutoBind(autoBind: false)11. .Filter(FilterType.Contains)12. // define a custom data source to handle the kendo .ToDataSourceResult method13. .DataSource(ds => ds.Custom().Type(type: "aspnetmvc-ajax").Transport(trans => { trans.Read(read => read.Action(actionName: "GetCultures", controllerName: "ResourcesGrid").Data(handler: "GetTypeAhead")); })14. .ServerFiltering(enabled: true)15. .Schema(schema => { schema.Data(data: "Data").Total(total: "Total"); }))16. )17.</div>
After upgrading to Kendo 2016.3.1118 and jQuery 3.1.1 I get the following error message and jquery migrate hints in the console. Any ideas what I need to change to get this fixed?
Kind regards
Bernd
001.VM4028:590 Detected Kendo UI version: "2016.3.1118"002.browserLink:64 [16:46:54 GMT+0100 (Mitteleuropäische Zeit)] Browser Link: Failed to send message to browser link server:003.Error: SignalR: Connection must be started before data can be sent. Call .start() before .send()004.kendo.all.js:9192 Uncaught Error: The deferredValue binding is not supported by the input element005. at init.applyBinding (kendo.all.js:9192)006. at init.bind (kendo.all.js:9155)007. at a (kendo.all.js:9305)008. at a (kendo.all.js:9314)009. at a (kendo.all.js:9314)010. at a (kendo.all.js:9314)011. at Object.s [as bind] (kendo.all.js:9329)012. at init.refresh (kendo.all.js:38975)013. at new init (kendo.all.js:38881)014. at HTMLDivElement.<anonymous> (kendo.all.js:2409)015.applyBinding @ kendo.all.js:9192016.bind @ kendo.all.js:9155017.a @ kendo.all.js:9305018.a @ kendo.all.js:9314019.a @ kendo.all.js:9314020.a @ kendo.all.js:9314021.s @ kendo.all.js:9329022.refresh @ kendo.all.js:38975023.init @ kendo.all.js:38881024.(anonymous) @ kendo.all.js:2409025.each @ jquery-3.1.1.js:368026.each @ jquery-3.1.1.js:157027.e.fn.(anonymous function) @ kendo.all.js:2408028._createPopupEditor @ kendo.all.js:47833029.editRow @ kendo.all.js:47670030.addRow @ kendo.all.js:48072031.(anonymous) @ kendo.all.js:48108032.dispatch @ jquery-3.1.1.js:5201033.elemData.handle @ jquery-3.1.1.js:5009034.jquery-migrate-3.0.0.js:62 JQMIGRATE: jQuery.fn.removeAttr no longer sets boolean properties: disabled035.migrateWarn @ jquery-migrate-3.0.0.js:62036.(anonymous) @ jquery-migrate-3.0.0.js:216037.each @ jquery-3.1.1.js:368038.jQuery.fn.removeAttr @ jquery-migrate-3.0.0.js:214039._editable @ kendo.all.js:31523040.readonly @ kendo.all.js:27301041._enable @ kendo.all.js:27667042.init @ kendo.all.js:31098043.init @ kendo.all.js:61791044.(anonymous) @ kendo.all.js:2409045.each @ jquery-3.1.1.js:368046.each @ jquery-3.1.1.js:157047.e.fn.(anonymous function) @ kendo.all.js:2408048.initialize @ kendo.all.js:62262049.(anonymous) @ kendo.all.js:62633050.each @ jquery-3.1.1.js:368051.each @ jquery-3.1.1.js:157052.bindTo @ kendo.all.js:62624053.init @ kendo.all.js:54606054.(anonymous) @ kendo.all.js:2409055.each @ jquery-3.1.1.js:368056.each @ jquery-3.1.1.js:157057.e.fn.(anonymous function) @ kendo.all.js:2408058.(anonymous) @ VM4039:1059.mightThrow @ jquery-3.1.1.js:3570060.process @ jquery-3.1.1.js:3638061.jquery-migrate-3.0.0.js:64 console.trace062.migrateWarn @ jquery-migrate-3.0.0.js:64063.(anonymous) @ jquery-migrate-3.0.0.js:216064.each @ jquery-3.1.1.js:368065.jQuery.fn.removeAttr @ jquery-migrate-3.0.0.js:214066._editable @ kendo.all.js:31523067.readonly @ kendo.all.js:27301068._enable @ kendo.all.js:27667069.init @ kendo.all.js:31098070.init @ kendo.all.js:61791071.(anonymous) @ kendo.all.js:2409072.each @ jquery-3.1.1.js:368073.each @ jquery-3.1.1.js:157074.e.fn.(anonymous function) @ kendo.all.js:2408075.initialize @ kendo.all.js:62262076.(anonymous) @ kendo.all.js:62633077.each @ jquery-3.1.1.js:368078.each @ jquery-3.1.1.js:157079.bindTo @ kendo.all.js:62624080.init @ kendo.all.js:54606081.(anonymous) @ kendo.all.js:2409082.each @ jquery-3.1.1.js:368083.each @ jquery-3.1.1.js:157084.e.fn.(anonymous function) @ kendo.all.js:2408085.(anonymous) @ VM4039:1086.mightThrow @ jquery-3.1.1.js:3570087.process @ jquery-3.1.1.js:3638088.jquery-migrate-3.0.0.js:62 JQMIGRATE: jQuery.fn.removeAttr no longer sets boolean properties: readonly089.migrateWarn @ jquery-migrate-3.0.0.js:62090.(anonymous) @ jquery-migrate-3.0.0.js:216091.each @ jquery-3.1.1.js:368092.jQuery.fn.removeAttr @ jquery-migrate-3.0.0.js:214093._editable @ kendo.all.js:31524094.readonly @ kendo.all.js:27301095._enable @ kendo.all.js:27667096.init @ kendo.all.js:31098097.init @ kendo.all.js:61791098.(anonymous) @ kendo.all.js:2409099.each @ jquery-3.1.1.js:368100.each @ jquery-3.1.1.js:157101.e.fn.(anonymous function) @ kendo.all.js:2408102.initialize @ kendo.all.js:62262103.(anonymous) @ kendo.all.js:62633104.each @ jquery-3.1.1.js:368105.each @ jquery-3.1.1.js:157106.bindTo @ kendo.all.js:62624107.init @ kendo.all.js:54606108.(anonymous) @ kendo.all.js:2409109.each @ jquery-3.1.1.js:368110.each @ jquery-3.1.1.js:157111.e.fn.(anonymous function) @ kendo.all.js:2408112.(anonymous) @ VM4039:1113.mightThrow @ jquery-3.1.1.js:3570114.process @ jquery-3.1.1.js:3638115.jquery-migrate-3.0.0.js:64 console.trace116.migrateWarn @ jquery-migrate-3.0.0.js:64117.(anonymous) @ jquery-migrate-3.0.0.js:216118.each @ jquery-3.1.1.js:368119.jQuery.fn.removeAttr @ jquery-migrate-3.0.0.js:214120._editable @ kendo.all.js:31524121.readonly @ kendo.all.js:27301122._enable @ kendo.all.js:27667123.init @ kendo.all.js:31098124.init @ kendo.all.js:61791125.(anonymous) @ kendo.all.js:2409126.each @ jquery-3.1.1.js:368127.each @ jquery-3.1.1.js:157128.e.fn.(anonymous function) @ kendo.all.js:2408129.initialize @ kendo.all.js:62262130.(anonymous) @ kendo.all.js:62633131.each @ jquery-3.1.1.js:368132.each @ jquery-3.1.1.js:157133.bindTo @ kendo.all.js:62624134.init @ kendo.all.js:54606135.(anonymous) @ kendo.all.js:2409136.each @ jquery-3.1.1.js:368137.each @ jquery-3.1.1.js:157138.e.fn.(anonymous function) @ kendo.all.js:2408139.(anonymous) @ VM4039:1140.mightThrow @ jquery-3.1.1.js:3570141.process @ jquery-3.1.1.js:3638