Telerik Forums
Kendo UI for jQuery Forum
1 answer
263 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
309 views

Hello,

I need use export excel With ProxyURL 

i got error when I click on the button export to excel 

Samlpe Dojo

thanks

Lance | Senior Manager Technical Support
Telerik team
 answered on 03 Oct 2022
1 answer
536 views

I need to display a table for the autocomplete (like the multicombobox).

I have already done this on a previous version of telerik with the code:

                              .HeaderTemplate("<div class=\"k-grid-header\" style=\"padding-right: 17px;\">" +
                                                "<div class=\"k-grid-header-wrap\">" +
                                                   "<table>" +
                                                      "<colgroup>" +
                                                         "<col>" +
                                                         "<col>" +
                                                         "<col>" +
                                                         "<col>" +
                                                      "</colgroup>" +
                                                      "<tbody>" +
                                                         "<tr>" +
                                                            "<th class=\"k-header\">P1</th>" +
                                                            "<th class=\"k-header\">P2</th>" +
                                                            "<th class=\"k-header\">P3</th>" +
                                                            "<th class=\"k-header\">P4</th>" +
                                                         "</tr>" +
                                                      "</tbody>" +
                                                   "</table>" +
                                                "</div>" +
                                             "</div>")
                              .Template("<span class=\"k-cell\">#: data.P1#</span>" +
                                        "<span class=\"k-cell\">#: data.P2#</span>" +
                                        "<span class=\"k-cell\">#: data.P3#</span>" +
                                        "<span class=\"k-cell\">#: data.P4#</span>")
but this one does not work anymore in the current version. I do not remember from where I took this example and I cannot find an example anymore. Is this because the multicombobox was created?
Eyup
Telerik team
 answered on 03 Oct 2022
1 answer
758 views

Grid :-

.Columns(columns =>
{
    columns.Bound(x => x.Role).Title("<b>Project OBS Role</b>").Width("30%").Filterable(true).
    HeaderHtmlAttributes(new { style="text-align:center;"}).HeaderHtmlAttributes(new { style = "text-align:center;vertical-align:middle;" });

    columns.Bound(x => x.UserId).Title("<b>Approver</b>").Width("40%").EditorTemplateName("GridGroupPeoplePicker").
   ====>  EditorViewData(new { SecurityGroup = "#=SecurityGroup#" }).Filterable(true).HeaderHtmlAttributes(new { style = "text-align:center;vertical-                     align:middle;"       }).HtmlAttributes(new { style = "text-align:left;" });

    columns.Bound(x => x.Delay).Title("<b>Delay<b>").Width("20%").Filterable(true).
    HeaderHtmlAttributes(new { style = "text-align:center;vertical-align:middle;" }).HtmlAttributes(new { style = "text-align:left;" });

    columns.Command(command => { command.Edit().Text(" ").CancelText(" ").UpdateText(" ");}).Width("10%").
    HtmlAttributes(new { style = "text-align:center;" });
})

 

Editor Template :-

@model string
@{
    string Groups = ViewData["SecurityGroup"] as string;
}
<input type="hidden" id="hdn@(Html.IdForModel())" data-bind="value: @(Html.IdForModel())" disabled="disabled" />
<input type="hidden" id="GroupName_@(Html.IdForModel())" data-bind="value: @(Groups)" disabled="disabled" />
<script>
    function GetGroups_@(Html.IdForModel())(e) {
        debugger;
        var filterInput = $('#hdn@(Html.IdForModel())').val();
        var Groups = $('#GroupName_@(Html.IdForModel())').val();
        return { PickerFilter: filterInput, GroupNames: '@Groups', IsUsersByGroup: 'false' };
    }
</script>
@(Html.Kendo().DropDownListFor(m => m)
        .DataValueField("Value")
        .DataTextField("Text")
        .Filter(FilterType.Contains)
        .MinLength(3)
        .AutoBind(false)
        .DataSource(ds =>
        {
            ds.ServerFiltering(true).Read(r => r.Action("GetUserByGroups", "Common").Data("GetGroups_" + Html.IdForModel()));
        })
)
Aleksandar
Telerik team
 answered on 30 Sep 2022
1 answer
186 views

We have need of a way to show an editor when user clicks on a plain HTML element. There will be more fields than visible when the div goes into edit mode. Same way we use a clientTemplate in our KendoGrids.

I picture,

  1. listening for click on a div
  2. showing an already-instantiated kendoWindow
  3. populate it with the edit values we want
  4. Prefer to position window exactly over the element being edited
  5. allowing the user to edit
  6. on enter key or tab out of the last field, transfer the changes back to the div
  7. hide the kendoWindow ready for re-use

If no examples exist, it would be nice to hear from moderators on why this couldn't be done. Or, better, how nicely it could work :-)

I've done something like this about 7 years ago and it worked well, but I no longer have access to that code-base.

Bob Graham

Neli
Telerik team
 answered on 30 Sep 2022
1 answer
108 views

Hello,

 

I want the tooltip to remain open when trying to click on the content of tooltip. Below is my code.

---Grid

 @(Html.Kendo().Grid<AgeInformation>()
    .Name("AgeInformationGrid")
    .Columns(columns =>
    {
        columns.Bound(p => p.FundAge).Title("Agency").ClientTemplate("#=FundAge.FedAgeDesc#").Sortable(false).Width(175).HeaderHtmlAttributes(new { @class = "FundAgeClass" });

  })

    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Scrollable()
    .HtmlAttributes(new { style = "height:500px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .AutoSync(false)
        .Batch(false)
        .PageSize(20)
        .ServerOperation(false)
        .Events(events => events.Error("errorHandler"))
        .Events(events => events.RequestEnd("onAgeInformationRequestEnd"))
        .Model(model => {
            model.Id(p => p.AgeInformationId);
            model.Field(p => p.AgeInformationId).Editable(false);
           model.Field(p => p.FundAge).DefaultValue(new FedAgency());
        })
        .Create(update => update.Action("AddAgeInformation", "Coversheet").Type(HttpVerbs.Post))
        .Read(read => read.Action("GetAgeInformation", "Coversheet").Type(HttpVerbs.Get))
        .Update(update => update.Action("EditAgeInformation", "Coversheet").Type(HttpVerbs.Post))
        .Destroy(update => update.Action("DeleteAgeInformation", "Coversheet").Type(HttpVerbs.Post))
    )
    //.Events(events => events.Edit("onAgeInformationEdit"))
    )    

 

 function ToolTipsForAgency() {

 

        $(".FundAgeClass").append("&nbsp;<i class='far fa-question-circle'></i>");       

$(".FundAgeClass").attr("data-html", "true");
       $(".k-dropdown, .FundAgeClass").find('i').attr("title", "More information can be found on this link <a href='https://google.com' title='test add link'>link on content</a>");
     

}

 

Any help is appreciated

Aleksandar
Telerik team
 answered on 30 Sep 2022
1 answer
130 views

When I tried to export excel, the data format changed.

For example, the data that is seen in the browser looks like this: 01:01:30 

However, checking the excel after export, the time shows like this: 3690, which is seconds.

How can I get the same format in the browser and in excel?

Thanks.

{
			field: "cn_busy_grp",
			title: "통화시간",
			columns :[{
				field: "ts_busy_times",
				title: "총통화시간",
				template: '#=convertSecondsToString(ts_busy_times, "hms")#',
				footerTemplate: '#=convertSecondsToString(sum, "hms")#',
				groupFooterTemplate: '#=convertSecondsToString(sum, "hms")#',
				width: "80px"
			},


Nikolay
Telerik team
 answered on 29 Sep 2022
0 answers
101 views

I am trying to select any step and when selecting it load information in a grid, but with the select event it only works in the step before or after the active one.

 var stepper = $("#stepper").kendoStepper({
                steps: Objson,
                select: function(e) {
                    console.log("i found");
                    e.preventDefault();}              }).getKendoStepper();
Oscar
Top achievements
Rank 1
 asked on 28 Sep 2022
1 answer
239 views

Hi,

I'm tryign to dynamically change the tagMode of a kendo.ui.DropDownTree as a user selects more or less items but the control does not refresh/rerender

 

Below is a sample of the code I have tried...

 var ddt = $(id).data('kendoDropDownTree');
        var maxSelectedItemsDisplayedInSingleTagMode = 3;
        let selectedValues = ddt.value();
        let currentTagMode = ddt.options.tagMode;
        let newTagMode = currentTagMode;

        newTagMode = selectedValues.length <= maxSelectedItemsDisplayedInSingleTagMode ? "multiple" : "single";
        if (newTagMode != currentTagMode) {
            ddt.value([])
            ddt.setOptions({
                tagMode: newTagMode
            });
            ddt.value(selectedValues);
        }

Something similar does work for the kendo.ui.MultiSelect but I cannot get it to play ball for kendo.ui.DropDownTree

 

Thanks

Neli
Telerik team
 answered on 28 Sep 2022
1 answer
475 views

I get content as HTML encoded and would like to render this content as HTML in a grid row column using a template.

template: window.kendo.template($("#title").html())

<script id="title" type="text/x-kendo-template">
  <strong>#:title#</strong>
  <div>#:content#</div>
</script>

Have tried many (all) combinations of #:content#, #=content#, encoded: false, kendo.htmlEncode...

Please see the screenshot.

What am I doing wrong?

/Morten

 

Nikolay
Telerik team
 updated answer on 27 Sep 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?