Hello everyone! I have a few custom grid filters that I've been using in my code that broke when I updated to the newest release of Kendo UI (2015.1.429). By broken, I mean that they don't load the optionLabel immediately and they are squashed on load. (See attached screenshot.) If I click on the dropdown, it does still load the information and the optionLabel shows, as well as it becomes the correct size, just not on load. Below is the code (js) I use for a State Filter and the grid it goes with:
$(document).ready(function () {
function stateFilter(element) {
element.kendoDropDownList({
dataTextField: "Name",
dataValueField: "Name",
dataSource: new kendo.data.DataSource({
schema: {
model: {
id: "StateId"
}
},
transport: {
read: {
url: "/Helper/GetStates",
dataType: "json"
}
}
}),
optionLabel: "--Select Value--"
});
}
$("#CompaniesGrid").kendoGrid({
dataSource: new kendo.data.DataSource({
schema: {
model: {
id: "CompanyId",
fields: {
IsActive: { type: "boolean" }
}
}
},
transport: {
read: {
url: "/Company/GetCompanies",
dataType: "json"
}
},
filter: {
field: "IsActive",
operator: "eq",
value: true
},
pageSize: 100
}),
sortable: true,
pageable: true,
scrollable: false,
columns: [
{
field: "Name",
title: "Company",
template: "<
a
href
=
'/Company/Detail/#:CompanyId#'
>#:Name#</
a
>"
},
{
field: "City",
title: "City"
},
{
field: "State",
title: "State",
width: "90px",
filterable: {
ui: stateFilter,
operators: {
string: {
eq: "Is equal to"
}
}
}
},
{
field: "Phone",
title: "Phone Number",
filterable: false
},
{
field: "PrimaryContactDisplay",
title: "Primary Contact",
template: "#if(PrimaryContactId == null){##}else{# <
a
href
=
'/Contact/Detail/#:PrimaryContactId#'
>#:PrimaryContactDisplay#</
a
> #}#"
},
{
field: "IsActive",
title: "Active",
template: "#: IsActive ? 'Yes' : 'No' #",
width: "90px"
}],
filterable: {
extra: false,
messages: {
isTrue: "Yes",
isFalse: "No"
}
}
});
});
Note that there are two custom filters on this page: The Site Filter and the Status Filter. The Status Filter works just fine. It's just the Site Filter (and all of the other filters I use that are used similarly.) Any help here would be greatly appreciated. It's a small thing, but it bugs me. (See what I did there? :) )
Thanks!
Anna