Telerik Forums
Kendo UI for jQuery Forum
5 answers
1.2K+ views

Hello,

I'm using the following custom code for tooltips:

01.$('#' + tooltipContainerDivId).kendoTooltip({
02.    filter: filter,
03.    position: 'right',
04.    animation: {
05.        open: {
06.            effects: 'fade:in',
07.            duration: 200
08.        },
09.        close: {
10.            effects: 'fade:out',
11.            duration: 200
12.        }
13.    },
14.    // Show tooltip only if the text of the target overflows with ellipsis.
15.    show: function() {
16.        var cWidth = computeElementWidth(this.content, tooltipWidthWorkaroundDivId);
17.        if (this.content.text().trim() !== '') {
18.            $('[role="tooltip"]').css({
19.                width: cWidth + 10,
20.                visibility: 'visible'
21.            });
22.        }
23.    },
24.    hide: function() {
25.        $('[role="tooltip"]').css('visibility', 'hidden');
26.    },
27.    // Apply additional custom logic to display the text of the relevant element only.
28.    content: function content(e) {
29.        var $element = $(e.target[0]);
30.        var cWidth = computeElementWidth($element, tooltipWidthWorkaroundDivId);
31.        var dataTooltipAttr = $element.attr('datatooltip');
32. 
33.        if (cWidth > $element.width() || dataTooltipAttr) {
34.            // Text was truncated, or we have a custom tooltip message.
35.            if (dataTooltipAttr) {
36.                return dataTooltipAttr;
37.            }
38. 
39.            return e.target.text();
40.        } else {
41.            return '';
42.        }
43.    }
44.});

The main reason for this is to display tooltip only if the text would be too short to fit within a grid cell.

This is working fairly well, the only major problem that we have with this is that the little arrow indicator is sometimes not aligned properly. If I remove this custom code, the arrow is always correctly aligned. I assume that internally there is some code that positions the arrow based on the box that kendo builds, but since I resize this box, the arrow is then positioned incorrectly.

What would be the proper way to solve my problem ? Is there already a way to perform the behaviour that I want ? the thing is there are also some cases where we always want to display the tooltip because it contains extra information not displayed in the cell, so I think that either way we need custom code.

Is there a way to override the way the arrow position is computed ?

As we can see on both the attached screenshots, the arrow's position is in both cases not quite right, and it seems to depend on what element I hovered previously, if I hover the element above I get something, and if I hovered the element below I get something else when I come back to that element from the attached screenshot.

Thanks !

 

Misho
Telerik team
 answered on 14 Apr 2020
7 answers
2.9K+ views

In this demo:

http://demos.telerik.com/kendo-ui/bar-charts/column

There is a legend on the top of the chart. If you click on one of the series in the legend, that data in the chart is not visible. Is there a way to programmatically do this? I want to provide this feature via an edit popup.

Thanks,

--Ed​

Feriansyah
Top achievements
Rank 1
 answered on 14 Apr 2020
3 answers
1.0K+ views
Hello-

In release v2013.2.918 we were taking advantage of the chart's legendItemClick default functionality of hiding series on a click event.

We also had some add'l buttons on our page that we tied in to this functionality to programmatically trigger the legendItemClick with a simple:

$('legend-item-element').click()

and the user could click these other (non-Kendo) buttons and show/hide chart series. This worked great - see this fiddle:

http://jsfiddle.net/gtP55/


Since the last release, we can no longer successfully call $('legend-item-element').click(). The click event is not properly triggered programatically. Is there any way to do so? This functionality is heavily enmeshed in our page now and users are expecting it.

Thanks!

James
Alex Hajigeorgieva
Telerik team
 answered on 14 Apr 2020
2 answers
547 views

Below is my coding.

Here i want to do a if condition in "Comments" column. if comments available then i need to replace it as "1". if its empty then "0".

1. Either i can introduce new column at the end and apply the above condition and hide the "Comment" column (as this value depend on child row)

2. or directly modify the comment column

 

<div id="grid"></div>
                    <button id="btnprint" type="submit" name="excel" value="valexcel">Print</button>
<script> $("#grid").kendoGrid({ columns: [{ field: "productName" }, { field: "category" }, { field: "status" }, { field: "Comments" }], dataSource: { data: [{ productName: "Tea", category: "Beverages", status: "Open", "Comments": "" }, { productName: "Coffee", category: "Beverages", status: "Open", "Comments": "comment1" }, { productName: "Ham", category: "Food", status: "Open", "Comments": "" }, { productName: "Bread", category: "Food", status: "Open", "Comments": "" }, { productName: "Hammer", category: "Hardware", status: "Closed", "Comments": "Comment test" }, { productName: "Screw", category: "Hardware", status: "Open", "Comments": "commenting testing" }], group: { field: "category" } },  detailTemplate: "<div class='Comments'>",
                    detailInit: function (e) { e.detailRow.find(".Comments").html("<p>" + e.data.Comments + "</p>"); }, });</script>

Kirubakaran
Top achievements
Rank 1
 answered on 14 Apr 2020
19 answers
3.4K+ views
I am working with the grids, and I would like to hide the detail grid and indicator when the the datasource returns empty.  Looking through the forums, I found the suggestion of 

"After the grid is populated(i.e DataBound event is triggered) you can remove the css class for desired.k-master-row>.k-hierarchy-cell>a element. That is the only way to hide the expand/collapse arrow"

Can someone point me to a code sample where this is working?  This seems like something that I would need to do inside the detail grid, but I cannot figure out where.  Below is my function in case it is needed.

Thanks for your help.

function detailInit(e) {
    $("<div/>").appendTo(e.detailCell).kendoGrid({
        dataSource: {
            type: "json",
            transport: {
                read: "/DashController/GetMoreReports?Id=" + e.data.ReportId
            },
            serverPaging: true,
            serverSorting: true,
            pageSize: 10,
        },
        scrollable: false,
        sortable: true,
        pageable: true,
        columns: [
                            {
                                template: '<a href="/ReportId=#=ReportId#">#=ReportNumber#</a>',
                                title: "Report"
                            },
                            {
                                field: "Summary"
                            }
                        ]
    });
Nithin Reddy
Top achievements
Rank 1
 answered on 13 Apr 2020
3 answers
666 views

 i have the following coding.  I want to print this as it is in a button click ( with same color, styles etc..)

 

<div id="grid"></div>
                    <button id="btnprint" type="submit" name="excel" value="valexcel">Print</button>
<script> $("#grid").kendoGrid({ columns: [{ field: "productName" }, { field: "category" }, { field: "status" }, { field: "Comments" }], dataSource: { data: [{ productName: "Tea", category: "Beverages", status: "Open", "Comments": "" }, { productName: "Coffee", category: "Beverages", status: "Open", "Comments": "comment1" }, { productName: "Ham", category: "Food", status: "Open", "Comments": "" }, { productName: "Bread", category: "Food", status: "Open", "Comments": "" }, { productName: "Hammer", category: "Hardware", status: "Closed", "Comments": "Comment test" }, { productName: "Screw", category: "Hardware", status: "Open", "Comments": "commenting testing" }], group: { field: "category" } },  detailTemplate: "<div class='Comments'>",
                    detailInit: function (e) { e.detailRow.find(".Comments").html("<p>" + e.data.Comments + "</p>"); }, });</script>

I tried with the following link and cannot achieve this.

https://docs.telerik.com/kendo-ui/controls/data-management/grid/export/print-export

-- I can achieve this by converting this grid to pdf and print it. But i dont want to do it and want to print this directly

Expecting your help.

 

Tsvetomir
Telerik team
 answered on 13 Apr 2020
3 answers
537 views

Hi,
I'm trying to create an Arc Gauge with a centerTemplate that won't use "value". The centerTemplate is going to display percentage of RAM and the actual RAM used (see attached image).
If I were to only show the percentage, it wouldn't be any problem.
Currently, my code for the Arc Gauge looks like this:

@(Html.Kendo().ArcGauge()
    .Name("MemoryBar")
    .Value(Model.CurrentMemoryPercent)
    .Scale(x => x.Min(0).Max(100))
    .CenterTemplate(string.Format("{0}% ({1})", Model.CurrentMemoryPercent, size))
)

That just creates a static CenterTemplate, though, and none of the variables are updated unless I refresh the page.

I can kinda work around this by using setoptions, but that redraws the entire gauge and forces me to disable transitions, which I don't want to.

Am I missing something completely, or can't this be done properly?

Thanks for any help.

 

 

 


Tsvetomir
Telerik team
 answered on 13 Apr 2020
7 answers
2.0K+ views

I'm using Kendo UI for jQuery.

All my grids render with 20 columns at the least, and although I have set multiple choices for pagesizes available, it's likely that for most of the time when people use my application, they'll be dealing with grid data with all of the rows rendered at the same time (>4000).

Problem is, when all the rows are rendered, the grid is slowed and lagged beyond use; hover states are not matching between fixed and column rows (which I had to write a separate script for), scrolling is lagging or at times impossible, checkboxes take good 3 seconds before it's checked, 5 seconds to uncheck it, etc. Not only does it render so slow that my entire browser freezes, after it renders it basically prevents me from doing anything else within my website. 

I tried scrollable (virtual, endless), server scrolling, server paging, changing databinding & databound functions, but nothing seems to resolve the speed issue. From what I just checked it takes 4 seconds to resize itself after I changed the browser size. The essentials of my grid relies on displaying large amounts of data to be able to manipulate them, and this lagging is practically rendering my pages unusuable. I'm wondering if this issue could be fixed by Telerik. Thanks in advance.

Angel Petrov
Telerik team
 answered on 13 Apr 2020
3 answers
134 views

I'm tasked with creating a modal that contains three kendo grids that are presented like a treeView. When pressing the expand button for each grid, the details will appear. For a clearer picture of what I'm trying to achieve, please refer to the image attached.

 

I've succeeded in creating each kendo grid individually. However, they do not collapse/expand. Each Kendo grid is usually different from the others so I don't believe I can do something like https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/detailinit. Is it possible to accomplish what's shown in the image I attached?

Martin
Telerik team
 answered on 13 Apr 2020
2 answers
210 views

I have integer based data. So I set my label format to be {0:N0}.If I have a limited data set (0, 1) I would only want two lines on the chart for 0 and 1. Instead I get lines for 0.0, 0.2, 0.4, 0.6, 0.8, 1.0 etc. Due to the value rounding these all appear as 0, 0, 0, 1, 1, 1. This looks really stupid.

Here's a Dojo showing what i mean: https://dojo.telerik.com/UvePaCOj/2

Paul
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 13 Apr 2020
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?