kendo-dropdown

How to set default value in Kendo DropDownList

ぐ巨炮叔叔 提交于 2020-12-30 06:59:12
问题 I have a Kendo DropDownList, but strangely enough I can not set its initial value. Html.Kendo().DropDownList() .Name("PersonalCoachName") .BindTo(new SelectList((List<string>)ViewData["coachResources"])) .HtmlAttributes(new { style = "font-size:8pt;" }) ViewData["coachResources"] is a List of string type. Regardless I use .BindTo(new SelectList((List<string>)ViewData["coachResources"], "Default")) or .SelectedIndex(3) DropDownList does not change it value and only display the 1st value in the

How to set default value in Kendo DropDownList

爷,独闯天下 提交于 2020-12-30 06:59:06
问题 I have a Kendo DropDownList, but strangely enough I can not set its initial value. Html.Kendo().DropDownList() .Name("PersonalCoachName") .BindTo(new SelectList((List<string>)ViewData["coachResources"])) .HtmlAttributes(new { style = "font-size:8pt;" }) ViewData["coachResources"] is a List of string type. Regardless I use .BindTo(new SelectList((List<string>)ViewData["coachResources"], "Default")) or .SelectedIndex(3) DropDownList does not change it value and only display the 1st value in the

Kendo DropDownList in Grid shows value after selection

梦想与她 提交于 2020-01-21 08:02:45
问题 I'm trying to use a drop-down list in my grid. This is my grid definition: $("#grid").kendoGrid({ editable: true, dataSource: { data: data, schema: { model: { fields: { Name: { type: "string", editable: false }, FruitName: { type: "string" }, FruitID: { type: "number" } } } } }, columns: [{ field: "Name", title: "Name", width: 150 }, { field: "Fruit", title: "Fruit", width: 115, editor: renderDropDown, template: "#=FruitName#" }] }); And this is my editor function: function renderDropDown

Kendo UI Web - DropDownList: select event doesn't return selected value properly

只谈情不闲聊 提交于 2020-01-15 07:05:53
问题 I am binding a DropDownList widget to select event like so: var items = [ { text: 'Item 3', value: '3' }, { text: 'Item 4', value: '4' } ]; var dropDownListEl = $('#dropdownlist'); dropDownListEl.kendoDropDownList({ dataTextField: 'text', dataValueField: 'value', index: 0 }); var kDropDownList = dropDownListEl.data('kendoDropDownList'), ds = kDropDownList.dataSource; items.forEach(function (item) { ds.add(item); }); kDropDownList.bind('select', function (e) { console.log('this.value(): ' +

KendoUI Grid row filter with dropdown for boolean

梦想的初衷 提交于 2020-01-04 21:40:36
问题 The Filter basically works fine but, The select does not seem to fire the first selection this happens every time the filter is reset as well. I meddled with it for two days now... here is the Fiddle <script src="../content/shared/js/products.js"></script> <div id="grid"></div> <script> $(document).ready(function() { $("#grid").kendoGrid({ dataSource: { data: products, schema: { model: { fields: { ProductName: { type: "string" }, Discontinued: { type: "boolean" } } } }, pageSize: 20 }, height

KendoUI Grid row filter with dropdown for boolean

不想你离开。 提交于 2020-01-04 21:38:23
问题 The Filter basically works fine but, The select does not seem to fire the first selection this happens every time the filter is reset as well. I meddled with it for two days now... here is the Fiddle <script src="../content/shared/js/products.js"></script> <div id="grid"></div> <script> $(document).ready(function() { $("#grid").kendoGrid({ dataSource: { data: products, schema: { model: { fields: { ProductName: { type: "string" }, Discontinued: { type: "boolean" } } } }, pageSize: 20 }, height

get selected id of kendo drop down value

断了今生、忘了曾经 提交于 2020-01-02 08:49:53
问题 how to get id of selected name from dropdown. whene select Apples then got id 1 and select Oranges then 2 . this is simple kendo dropdown example. <body> <input id="dropdownlist" /> <script> $("#dropdownlist").kendoDropDownList({ dataSource: [ { id: 1, name: "Apples" }, { id: 2, name: "Oranges" } ], dataTextField: "name", dataValueField: "id", index: 1, select: onSelect }); function onSelect(e) { console.log(e); }; </script> </body> thanks. 回答1: In order to retrieve the selected Id you can

kendo ui select a specifix index/text during first load

安稳与你 提交于 2020-01-01 12:22:12
问题 The problem i am running into is that during the first load of the page i want to read the value from cookies if found, i want to change the theme that was stored in the cookie. not only want to change the them but i also want to select that item in the combo box so that it is in sync with the them that was applied. How can i select a specific item during initial page load, when i am constructing the combobox ? $(document).ready(function () { var initialized = false; // theme chooser drop

Filter local Kendo datasource based on other attribute of selected value in dropdown list

这一生的挚爱 提交于 2019-12-13 06:25:36
问题 I have a LOCAL Kendo datasource which has the following values: var dataSourceSearchOperators = new kendo.data.DataSource({ data: [ { OPERAND: "=", DATATYPE: "num", INFO: "Equal", OPERATOR: "eq" }, { OPERAND: "<>", DATATYPE: "num", INFO: "Not Equal", OPERATOR: "nq" }, { OPERAND: ">", DATATYPE: "num", INFO: "Greater Than", OPERATOR: "gt" }, { OPERAND: "CW", DATATYPE: "text", INFO: "Contains Word", OPERATOR: "contains" }, { OPERAND: "CP", DATATYPE: "text", INFO: "Contains Partial", OPERATOR: ""

How to set filter property through javascript or Jquery for a kendo dropdown

本秂侑毒 提交于 2019-12-12 06:50:00
问题 I have a kendo dropdown list in cshtml. I wanted to set filter property in Jquery or javasctipt. Could you please tell me how to acheive this? Appreciate your help on this. @(Html.Kendo().DropDownList() .Name("movies") .DataTextField("Text") .DataValueField("Value") .HtmlAttributes(new { style = "width: 100%" }) .BindTo(new List<SelectListItem>() { new SelectListItem() { Text = "The Shawshank Redemption", Value ="1" }, new SelectListItem() { Text = "The Godfather", Value ="2" }, new