I am looking for a help where I need to recreate the options for column filter values when the data on left hand side filter changes?
I have a drop down list country on left hand side and when ever user select the country the column(region), filter (custom filter, based on column on the grid) all the checkboxes for the custom filter should reflect the region as per the country selected.
We are currently trying to upgrade from 2019.3.917 to 2023.1.117
Some code that worked fine in the old version is failing in the new with error in kendo.combobox.js line 1221
Error message
Uncaught TypeError: Cannot read properties of undefined (reading 'renderButton')
Line 1221
values: kendo.cssProperties.roundedValues.concat([['full', 'full']])
the debugger is highlighting the second 'full'.
Our code is quite complex but commenting most of it out I get the same thing so a simplified version:
Our html page has this input
<input id="departments" style="width: 500px;" />
Then our javascript to create the combobox is
var $combo = $("#departments);
objKendoCB = $combo.kendoComboBox();
The second line results in the error. (the actual code sets lots of properties but I removed them one by one to end up with an empty method call).
Any ideas welcome!
I have Kendo Grid with "incell" editable mode and custom buttons for save, delete.
We have kendocombobox as editor and the user changes multiple rows before saving a row.
Is there a way to reset the previously edited row when the user moves to edit another row?
Hello!
I could not manage to implement a combobox widget with virtualization if the text/value fields are set with values which are not in the datasoruce:
Here is an example code:
$("#orders").kendoComboBox({
template: '#= OrderID # | #= ShipName #',
dataTextField: "ShipName",
dataValueField: "OrderID",
text: 'Not in the list',
value: 0,
virtual: {
itemHeight: 26,
valueMapper: function(options) {
$.ajax({
url: "https://demos.telerik.com/kendo-ui/service/Orders/ValueMapper",
type: "GET",
dataType: "jsonp",
data: convertValues(options.value),
success: function (data) {
options.success(data);
}
})
}
},
height: 520,
dataSource: {
type: "odata",
transport: {
read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
},
pageSize: 80,
serverPaging: true,
serverFiltering: true
}
});
Hi,
I want to add custom field to combobox Editor in Kendo grid but it's not working can anyone help me? Many thanks!
In the image below I have an IsActive : true column when loading data, but when I edit I don't see it.
I have written the following code for kendoComboBox, it does not cause any problem when creating, but when editing, only the id is displayed.
$('#buyer').kendoComboBox({
dataSource: new kendo.data.DataSource({
type: 'aspnetmvc-ajax',
serverFiltering: true,
serverPaging: true,
serverSorting: true,
transport: {
read: {
url: kmc.urlBase + '/lookups/buyers',
dataType: 'json',
type: 'POST',
beforeSend: function (xhr) {
kmc.setRequestVerificationToken(xhr);
}
}
},
schema: {
aggregateResults: 'aggregateResults',
data: 'data',
errors: 'errors',
total: 'total',
model: {
id: 'id',
fields: {
id: { type: 'number' },
name: { type: 'string' },
code: { type: 'string' },
cidNID: { type: 'string' },
addr: { type: 'string' },
tel: { type: 'string' },
fax: { type: 'string' }
}
}
},
error: function (e) {
if (e.status === 'customerror') {
pki.alert(e.errors);
} else {
var failure = pki.parseJson(e.xhr.responseText);
if (failure && failure.success === false) {
pki.alert('Status: ' + e.xhr.status + '<br/><br/>Error: ' + failure.errors);
} else {
pki.alert('Status: ' + e.xhr.status + '<br/><br/>Error: ' + e.xhr.responseText);
}
}
}
}),
dataTextField: 'name',
dataValueField: 'id',
filter: 'startswith',
valuePrimitive: true,
//change: function (e) {
// var dataItem = this.dataItem();
// if (dataItem) {
// pro.headerModel.set('buyer', { id: dataItem.Id, name: dataItem.Name });
// }
//},
minLength: 2,
select: function (e) {
var item = e.dataItem;
if (item) {
$('#buyer-name').text(`TO: ${item.name}`);
$('#buyer-addr').text(`ADD: ${item.addr}`);
$('#buyer-tel').text(`TEL: ${item.tel}`);
$('#buyer-fax').text(`FAX: ${item.fax}`);
$('#buyer-nid').text(`COMMERCIAL/NATIONAL ID: ${item.cidNID}`);
}
}
});
html code :
<td>
<span class="caption">Buyer: </span>
<input id="buyer" name="buyer" class="combobox-lg" data-bind="value: buyer.id" required />
</td>
Hey all,
I'm fairly new to kendo and have a bit of an problem ->
I'm currently troubleshooting a weird issue in version 2019.1.220. I'd love to upgrade but its not feasible for this project at this time.
Basically, what is going on is that we're seeing some weird behavior with the Combobox control after databind. Data comes from the database and is set in the control. When the Arrow (Open button) is clicked its almost as though it doesn't do a read on the datasource because I get the No items found message. However, if I change the selected text on the control it will do a pop open and locate the item in the list.
While trying to solve this with a work around I have tried to subscribe to the click event on the control and force a search function call in Kendo using the following:
$(document).ready(function () {
var itemCombo = $("#Items").data("kendoComboBox");
itemCombo.input.on("click", function () {
itemCombo.search(itemCombo.text);
});
});
This does seem to force a search to run on click of the control - however the arrow button on the control still does what it did before - not read the list or search for the item. Does anyone have any quick tips on how i can access the click event on the arrow button itself? The Open event isn't a good option - if I call .search on that it will cause an endless loop activity.
I'm sure this has been solved already in later versions but upgrade is not an option at this time.
Appreciative of any pointers! Thanks!
I'm trying to get the validation working on my form with kendovalidator
I'm using Telerik ver : 2019.2.619
$.validator.setDefaults({
ignore: ""
});
$(function () {
$("#form1").kendoValidator();
});
this shows validation messages correctly if values are empty eg:
issue is when an incorrect value is entered the message shows:
<div class="form-group row">
@Html.LabelFor(model => model.CountryCodeId, htmlAttributes: new { @class = "control-label col-md-2 required" })
<div class="col-md-10">
@(Html.Kendo().ComboBoxFor(m => m.CountryCodeId)
.Name("CountryCodeId")
.Placeholder(@Resources.Resources.CountryPlaceholder)
.DataTextField("Description")
.DataValueField("Id")
.Filter("contains")
.Suggest(true)
.DataSource(s => s.Read(r => r.Action("GetCountries", "Customer")).ServerFiltering(false))
.HtmlAttributes(new { style = "width:300px" })
)
@Html.ValidationMessageFor(model => model.CountryCodeId, "", new { @class = "text-danger" })
</div>
</div>
[Required(ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "CountryValidation")]
[Display(ResourceType = typeof(Resources.Resources), Name = "Country")]
public int? CountryCodeId { get; set; }
and if I enter a number the validation seems to pass, which it shouldn't
Validation should pass only if a country is selected from the combobox, entrering a numeric value or any other text which is not on the list should fail validation
How do I get default dataanotation message if an invalid entry is made?
Thanks