Telerik Forums
Kendo UI for jQuery Forum
1 answer
142 views
Hi I am wondering if it is possible to do filtering of detail rows using for example 2 combobox or dropdownlist values. Like if I select 1 dropdown value "Fred" I get all entries within that detail row matching "Fred" name field and then if I select "Blue" from second dropdown I get all matches of Name: "Fred" with Color: "Blue" .
Viktor Tachev
Telerik team
 answered on 15 Apr 2020
4 answers
1.1K+ views
I'm using version 2014.2.903 and I'm trying to format the numbers in the pager associated with my grid. The pager is showing 1-10 of 100000 and I would like to format the numbers so they have commas when appropriate. I tried accessing the pager information on the dataBound event, but unfortunately the pager hasn't been configured by the data from the datasource at that point so my changes get overwritten when the pager loads from the datasource.

I also tried doing something funky with the pageable: { messages: { of: "" } } configuration, but it's being ignored.

Here's my grid definition:

var grid = $("#grid").kendoGrid({
    name: "results",
    columns: columns,
    dataSource: new kendo.data.DataSource({
        type: "aspnetmvc-ajax",
        transport: {
            read: {
                url: "/Content/GetContent",
                type: "POST",
                dataType: "json",
                },
                error: function(xhr, error) {
                    alert("There was an error transporting the data from the server, likely because you've requested too much information. Try filtering the results further or selecting a smaller page size.");
                },
            },
        },
        pageSize: 10,
        serverPaging: true,
        serverSorting: true,
        schema: {
            total: "total",
            data: "data",
            model: {
                fields: {
                    Title: { type: 'string' },
                    Contributors: { type: 'string' },
                    ContentType: { type: 'string' },
                    IsForthcoming: { type: 'int' },
                    IsLive: { type: 'int' },
                    AlsoAvailableOn: { type: 'string' },
                    HasSecureCenterSetup: { type: 'int' },
                    SocrLink: { type: 'string' },
                    IsMarcRecord: { type: 'int' },
                    HasAssignment: { type: 'int' },
                    Size: { type: 'number' },
                    LastLoadedBy: { type: 'string' },
                    LastLoadedOn: { type: 'date', format: "{0:MM/dd/yyyy}" },
                    SeverityLevel: { type: 'number' },
                }
            }
        },
    }),
    pageable: { pageSizes: [10, 25, 50, 100] },
    sortable: true,
    scrollable: true,
    resizable: true,
    reorderable: true,
    dataBound: function(e) {
        if ($(".k-pager-sizes .l-viewall").length == 0) {
            $(".k-pager-sizes").append(' <input type="button" class="k-button k-button-icontext l-viewall" value="View All" />');
        }
        $(".l-viewall").click(function() {
            var dataSource = e.sender.dataSource,
                total = dataSource.total();
 
            dataSource.pageSize(total);
        });
    },
});

Any help would be greatly appreciated.

Rachael
Rumen
Telerik team
 answered on 15 Apr 2020
2 answers
119 views

As I know some events(like actionClick and collapse) and some Configuration(like collapse, alterningMode) are not working if I use custom template.

Is it a bug or not? 

Thanks,

Nurbek A.

Nurbek
Top achievements
Rank 1
 answered on 15 Apr 2020
1 answer
243 views
I have a grid, which has few columns. While filtering, columns other than date column are picking distinct values as part of the filter. But, when it is date, it is not picking the distinct values. So, is there any way using which the unique dates can be picked and displayed in the filter?
Viktor Tachev
Telerik team
 answered on 14 Apr 2020
3 answers
2.7K+ views

Hi,

We are seeing an issue with new Kendo upgrade (2020). There are 2 scenarios that we have found that Kendo grid pagination is not working.

Scenario 1 : 

Kendo pagination doesn't work on the pageload, but it starts working when I click F12 to inspect the elements. It was working fine with the old version (2017). Below is the source code for the Grid.

  @(Html.Kendo().Grid<vm>()
                                                            .Name("id")
                                                            .Columns(columns =>
                                                            {
                                                                columns.Bound(d => d.FirstName).Title("First Name").Width(150);
                                                                columns.Bound(d => d.LastName).Title("Last Name").Width(150);
                                                                columns.Bound(d => d.MemberAddress).Title("Address");
                                                                columns.Bound(d => d.MemberDOB_STR).Title("DOB").Format("{0:MM/dd/yyyy}").Width(100);
                                                                columns.Bound(d => d.MemberId).Title("Member ID").Width(140);
                                                                columns.Bound(d => d.ZipCode).Title("Zip Code").Width(120);                                                                
                                                            })
                                                            .ToolBar(tools => tools.Excel())
                                                          .Excel(excel => excel
                                                          .Filterable(true)
                                                            .Filterable(filterable => filterable.Extra(false).Operators(operators => operators.ForString(str => str.Clear().StartsWith("Starts with").IsEqualTo("Is equal to").IsNotEqualTo("Is not equal to"))))
                                                            .Scrollable(s => s.Height("200px"))
                                                            .Pageable()
                                                             .Resizable(resize => resize.Columns(true))                                                      
                                                            .Sortable()
                                                            .DataSource(dataSource => dataSource
                                                            .Ajax()
                                                             .Sort(s => s.Add("MemberId").Descending())
                                                            .PageSize(10)
                                                            .Read(read => read.Action("Some Action", "Controller").Data(""))
                                                        ).AutoBind(false)
            )

 

Scenario 2: 

 

In this case the pagination doesn't even work . The same was working fine with the old verison.

 

  @(Html.Kendo().Grid<DiagnosisICDVM>()
                            .Name("grdMemberDiagnosis")
                            .Events(e => e.DataBound("DisplayDataMessageMemberDiagnosis"))
                            .Columns(columns =>
                            {
                                columns.Bound(d => d.CDCode).Title("Code").Width(100);
                                columns.Bound(d => d.Description).Title("Diagnosis").Width(250);
                                columns.Bound(d => d.CodeVersion).Title("ICD Version").Width(120);
                                columns.Bound(d => d.ICDStartDate).Title("Start Date").EditorTemplateName("date").Format("{0:MM/dd/yyyy}").Width(120);
                                columns.Bound(d => d.ICDEndDate).Title("End Date").EditorTemplateName("date").Format("{0:MM/dd/yyyy}").Width(120);
                                columns.Bound(d => d.SourceType).Title("Source").Width(120).HtmlAttributes(new { title = "#=SourceType#" });
                            })
                            .ToolBar(tools => tools.Excel())
                                  .Excel(excel => excel
                                  .Filterable(true)
                        .Pageable(p => p.PageSizes(true).Refresh(true))
                        .Resizable(resize => resize.Columns(true))
                        .Sortable()
                        .Scrollable()
                    .DataSource(dataSource => dataSource
                        .Ajax()
                        .Sort(s => s.Add("CDCode"))
                        .PageSize(100)
                          .Model(model => { model.Id(p => p.CDCode); })
                        .Events(events => events.Error("error_handler"))
                        .Read(read => read.Action("Some Action", controller).Data("JSFunction")))
        )

Bootstrap 3 and JQuery 1.12.4 being used as per the Kendo recommendation.

Please help in resolving this issue as we are close on the deadlines.

 

Thanks

 

Ivan Danchev
Telerik team
 answered on 14 Apr 2020
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
3.0K+ 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.1K+ 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
564 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.6K+ 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
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
AICodingAssistant
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?