Telerik Forums
Kendo UI for jQuery Forum
0 answers
62 views

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.

Sterling
Top achievements
Rank 2
Iron
 updated question on 30 Nov 2022
1 answer
141 views

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");
});


Neli
Telerik team
 answered on 11 Nov 2022
1 answer
61 views

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.

 

Lyuboslav
Telerik team
 answered on 09 Nov 2022
1 answer
155 views

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>

Martin
Telerik team
 answered on 06 Oct 2022
1 answer
1.7K+ views

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.

Neli
Telerik team
 answered on 09 Sep 2022
0 answers
68 views

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?

Aleksandr
Top achievements
Rank 1
Bronze
Bronze
Veteran
 asked on 16 Aug 2022
0 answers
173 views

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

Amrendra
Top achievements
Rank 1
 asked on 01 Aug 2022
3 answers
93 views

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>

Johhny
Top achievements
Rank 1
Iron
 answered on 30 Jun 2022
0 answers
47 views
I have an OData 4 API in Dot Net to which I am making calls on a grid to read(GET), update(PUT), create(POST) and destroy (DELETE).

For some reason, the resulting AJAX call from the create does not include the model, and it is always null at the API handler, causing ModelState.IsValid to be false.

read, and update are both working fine, and API create(POST) call from Postman with correct JSON in the body of the request accomplishes the add.

Can't seem to figure out how I am misconfiguring the grid create transport. Have include screen shots of relevant code,  can include complete file of UI and API on request.

 I also have 2 short videos illustrating the create error and successful update, but since I cannot upload mp4 files, I have not included. they are available on request.

Any help would be greatly appreciated. Thanks!
Jose
Top achievements
Rank 1
 asked on 07 Jun 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?