Hi,
I have a DDL that gets its first value from a grid ("myValue"), a simple string that will be written to the DDL (same JSON format that the DDL is expecting
{
field1: "myValue",
field2: ""
}
). When the DDL is opened, the value I entered ("myValue") should be searched in the data source of the DDL and this value should be put into focus. In the end the JSON looks like this:
{
field1: "myValue",
field2: "describtion of myValue"
}
The DDL datasource has to compare the value from field1 ("myValue), if it matches it has to select it,
As long as I don't use virtual this works, but as soon as I use virtual it doesn't work anymore.
How can I achieve that the value from the grid is written into the DDL and the DDL then sets the correct data set into the focus?
Thanks in advance.
Hi,
I'm working with an older version of kendo elements. Currently I'm struggling with an tooltip. My Dropdown List shows additional information. However, when the selection changes, the old and new tooltip is displayed. Attached I have three screemshots, additional information (showing the first display of the tooltip), default tooltip (when there is no additional information) and additional information and default tooltip (after the defautl is displayed and a new item is selected). How can I make it to show only the current tooltip?
Here is my code for the tooltip:
$("#myElement").change(function(){
$("#myElement").kendoTooltip({
filter: ".k-input",
position: "top",
showAfter: 500,
content: function(e){
const dropdownlist = $("#myDdl").data("kendoDropDownList");
const selectedItem = dropdownlist.dataItem();
if (selectedItem.field2 === undefined) {
selectedItem.field2 = "This is the default tooltip";
}
const result = $("<div style='text-align: center';></div>").text(selectedItem.field2).css("width",
(selectedItem.field2.length * .6) + "em");
return result;
}
}).data("kendoTooltip");
});
I have a combobox that gets populated with a datasource. How can I disable a single item in the combobox based on the value of a different form field? For example, the combobox has 5 items, A, B, C, D, and E and they are all active. There is a form field called letterDoc and if letterDoc has a value of 8, I want to disable item A.
Is this possible?
Thank you.
I have a block of html that I want to move from one div to another div on the page using javascript. I am writing a function that will move this code block and will have no idea if, or how many, dropdown lists exist as it will be different every time. My problem is that when I do a .clone(true, true) with JQuery, the dropdownlist either stops opening or it opens with a width of 0 in the upper left corner of the screen. How do I fix this?
Task: Move everything from block1 to block2.
<div id="block1">
<p>Hi! I'm a paragraph.</p>
<select id="select1"></select>
The select was already initialized with JS and works fine.
</div>
<div id="block2">
</div>
I have a Kendo DropdownList as follows :
$("#txtTag").kendoDropDownList({
dataTextField: "TagDesc",
dataValueField: "TagId",
optionLabel: " ",
dataSource: {
transport: {
read: {
dataType: "json",
url: "/Data/GetTag"
}
}
},
change: onChange,
filter: "contains"
});
I have hidden one of the values by using
$("#txtTag_listbox li")[4].hidden = true;
However, when I do a filter/search on the dropdown List , the hidden item also appears in that list. How do I prevent it to not appear it in the list.
when we have the search option enabled for DDL we cant make a selection using keyboard & typeing the first letter (without expanding the drop down)
are there workaround to make it work togather?
Hello Team,
I am using one kendo dropdown control inside a form. While submitting the form value is properly binding. But when I am opening an existing form for editing, kendo dropdown is not showing the value which it is fetching from database.
In side view dropdown control---
<input id="AssignedTo" class="form-control" style="width: 250px;" />
<script type="text/javascript">
$(document).ready(function () {
$("#AssignedTo").kendoDropDownList({
autoBind: false,
filter: "contains",
dataTextField: "FullName",
dataValueField: "StaffID",
optionLabel: "Search by first or last name",
dataSource: {
serverFiltering: true,
pageSize: 80,
transport: {
read: {
url: "/Test/Staff/Search"
}
}
},
value: '@Model.StaffID'
});
})
So what is happening right now, when I am editing the form, the dropdown show "Search by First or last name", but when we expand the options, the expected option is already selected but the dropdown text is not set.
Attached the screenshots of the control.
Please provide solution to display the selected value when the form gets loaded.
Thanks
Amrendra
I have a filter on a datasource which in return updates a grid. The following are the code to filter and its' template handler.
The problem with this is that, I can load the categories at first when I'm creating the filters. But when I save and reload the filter from local storage, the category dropdown does not load. Please help me with this. It loads up only on a fresh filter.
Thanks in advance.
@(Html.Kendo().Filter<Lovely>()
.Name("OrgFilter")
.ApplyButton(true)
.ExpressionPreview(true)
.DataSource("DataSource")
.Fields(f =>
{
f.Add(p=>p.OrgName).Label("Organization");
f.Add(p=>p.CategoryId).Label("Category").EditorTemplateHandler("CategoryDropdown");
f.Add(p=>p.AsAtDate).Label("As At Date");
}))
<script>
function CategoryDropdown(container, options) {
$('<input data-bind="value: value" name="' + options.field + '"/>')
.appendTo(container)
.kendoDropDownList({
dataTextField: "CategoryId",
dataValueField: "CategoryId",
dataSource: @Json.Serialize(ViewData["Catogories"])
});
}
</script>