Telerik Forums
Kendo UI for jQuery Forum
9 answers
443 views
When using row templates, if you programatically hide a column and then apply sorting the hidden state is maintained on the headers but gets lost on the data row.

Check out this fiddle showing the problem http://jsfiddle.net/Tups/3GWzZ/7/

Am I doing something wrong or is this a bug?

Thanks in advance.
Nencho
Telerik team
 answered on 01 May 2020
1 answer
458 views

I am trying to delete more than 100 rows at a time from the grid.
I have a checkbox to select individual rows or a common checkbox to select all the rows on the page. The grid page size is 100.
The response from the server takes 3 secs but to delete it from the front end takes 15 secs i.e. the success function of ajax call.

 

I have also tried in the sucess function :-

$("#grid").find("input:checked").each(function () {                  
    var grid = $("#grid").data("kendoGrid");
    if (!$(this).parents('th').length) {
      grid.removeRow($(this).closest('tr'));
    }
  })    
}

This also has lead to 1 sec improvement in performance.

var selectedIds = grid.selectedKeyNames(); // gets the selectedrows
var param = $.param({ selectedIds : selectedIds }, true);
 
$.ajax({
    method: "POST",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    url: "testurl/?" + param ,
    success: function(response) {
        console.log(response);
        if (response.Success == true) {
            selectedIds.forEach(function(selectedId) {
                var item = grid.dataSource.get(selectedId);
                delete grid._selectedIds[selectedId]
                grid.dataSource.remove(item);
            });
            if (grid.dataSource.view().length == 0) {
                var currentPage = grid.dataSource.page();
                if (currentPage > 1) {
                    grid.dataSource.page(currentPage - 1);
                }
            }
        } else {
            alert("ERROR " + response.Error.Message);
        }
    },
    failure: function(err) {
        alert(err);
    }
});
}
Alex Hajigeorgieva
Telerik team
 answered on 30 Apr 2020
20 answers
1.3K+ views

Hello,

I'm trying to implement a custom widget using TypeScript. I will not inherit from another Widget.

Is there any sample or documentation? 

This is my code:

module mycompany.MyWidgets {
  "use strict";
 
  export class SampleWidget extends kendo.ui.Widget {
    constructor(element: Element, options?: MyInterfaces.ISampleOptions) {
      super(element, options);
    }
  }
   
  SampleWidget.fn = Sample.prototype;
  $.extend(true, {}, SampleWidget.options);
  (<ISampleOptions>SampleWidget.options).name = "SampleWidget";
  kendo.ui.plugin(SampleWidget);
}
interface JQuery {
  kendoSampleWidget(options?: ISampleOptions): JQuery
}

 

But the widget will not be used. Not using data-role nor jQuery selector $("#mydiv").kendoMyWidget();

Samples:

<div id='widgetcontainer' data-role='samplewidget'></div>

The widget constructor not will be called.

And:

<div id='widgetcontainer'></div>

window.onload = () => {
    $('#eidgetcontainer').kendoSampleWidget();
};

A script error will be shown (kendoSampleWidget is not a function)

What's the correct way?

Regards

Ralf

 

Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 30 Apr 2020
3 answers
1.2K+ views

After user saved the data in Popup, I want to prevent it from closing so user can adjust the data a little bit and then saved again many times.

How can I do that?  Thanks.

Viktor Tachev
Telerik team
 answered on 30 Apr 2020
1 answer
6.7K+ views

Kendo Grid Filter Date Column with format:

Hello,

I have a kendo grid with a date column

I'd like to create a filter for this column 

The fitler would be a calendar (datepicker)

The Back-end returns this date format: "2018-11-07T00: 00: 00.000"

Then the date will be converted into the column template

-------------------------------------------------------------------------------

Column of grid:

field: 'dateA', title:'"Date"',width:175, template: kendo.template($('[id=myTemplate]').html()),format: '{0:"dd-MM-yyyy "}',filterable: {ui: 'datepicker'}},"
 
-----------------------------------------------------
<script id="myTemplate" type="text/x-kendo-template">
#if(!Utils.isNullOrUndefined(dateA)){#
#:kendo.toString(kendo.parseDate(dateA, "yyyy-MM-ddTHH:mm:ss"), "dd-MM-yyyy")#
 #}else{#
 -
#}#
</script>

 

The filter does not work.

I'd like to filter date with this format " dd-MM-yyyy" using calendar widget

How can I solve this problem?

 

Shoji
Top achievements
Rank 2
 answered on 30 Apr 2020
12 answers
644 views

Hi,

I'm developing an SharePoint Framework webpart with Kendo UI and AngularJS. Kendo UI requires jQuery before AngularJS. As I want to develop multiple webparts with AngularJS and Kendo UI I decided to reference AngularJS and Kendo UI from external cdns.

 

This is the externals section in my config.json:

"externals": {
    "jquery": {
        "globalName": "jquery"
    },
    "angular": {
        "globalName": "angular",
        "globalDependencies": [
            "jquery"
        ]
    },
    "kendo": {
        "globalName": "kendo",
        "globalDependencies": [
            "jquery",
            "angular"
        ]
    }
},

 

I load AngularJS and Kendo UI in my Webpart.ts file:

import * as angular from "angular";
import "kendo";

 

My Angular app is working and the kendo.all.min.js file is loaded. I try to load the Kendo module like this:

angular.module("TestExternalWebpart", [ "kendo.directives" ]);

 

I get the following error from AngularJS:

Module 'kendo.directives' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

 

I've already tried to load Kendo with the following code in my webpart but I get same error:

import * as angular from "angular";
require("kendo");

 

How can I load Kendo UI from external cdn in a SPFx webpart? I've also created a sample on GitHub which produces the same error: https://github.com/jbgeesink/SPFx/tree/master/ExternalWebpart

 

Thanks!

Veselin Tsvetanov
Telerik team
 answered on 30 Apr 2020
3 answers
1.5K+ views

Hi,

 My web application uses Webpack and has been working great with Kendo UI (FREE.) This afternoon I pulled a copy of Kendo UI PRO (version: 2015.3.1005) from the private repository using bower and attempted to require("kendo-ui").

 The project builds successfully with Webpack but unfortunately on loading the web application it registers the following error in the console:

 "Uncaught TypeError: Cannot read property 'extend' of undefined"

 I've narrowed down the error to the kendo.editor.min.js, individually adding ALL other component references and excluding editor works as expected. Inclusion of kendo.editor.min.js breaks the project.

The function call involved seems to be:

function(){!function(e,t){var n,i,r=window.kendo,o=r.ui.editor,a=o.Dom,s=e.extend,l="xx-small,x-small,small,medium,large,x-large,xx-large".split(",")....

mehmet
Top achievements
Rank 1
 answered on 30 Apr 2020
1 answer
434 views

I am using a row template script in my kendo grid. By default, I want some columns to be hidden using the hidden: true property. When the grid is rendered, the column header of the hidden column does not appear, but the row data is still present. Here's a dojo showing my problem: https://dojo.telerik.com/IjUkuLAw

I also tried passing my column object as parameter to the template and then using some if-else condition inside it. This surely hides the column, but then if I want to hide any other column or show the previously hidden column using the columnMenu and then refresh the grid, the same problem arises. Here's an example: https://dojo.telerik.com/oMokUMUT/3

Also, I don't want to use any column template and would want to use the row template itself.

Plamen
Telerik team
 answered on 30 Apr 2020
2 answers
94 views

i have datepicker with mindate: 04/25/2020. today is 04/28/2020 and i disabled dates  < today, so how can I display 04/25/2020 in datepicker

my code:

<p> $("#txtStartDate").kendoDatePicker({<br>   format: "MM/dd/yyyy",<br>   isReadOnly: true,<br>   disableDates: function (date) {<br>      return compareDates(date);<br>   }<br>});</p><p></p><p>function compareDates(date) {<br>        var date = date && date.setHours(0, 0, 0, 0);<br>        var systemDate = getSystemDate();<br>        return date <= systemDate;<br>    }<br><br>    function getSystemDate() {<br>        var systemDate = new Date();<br>        systemDate.setDate(systemDate.getDate() - 1);<br>        return systemDate.setHours(0, 0, 0, 0);<br>    }</p>
Nikolay
Telerik team
 answered on 30 Apr 2020
4 answers
1.5K+ views

Hi.

I'm having issues trying to display tooltips only for grid headers and cells that have ellipsis using the logic indicated here:

http://docs.telerik.com/kendo-ui/controls/layout/tooltip/how-to/show-on-ellipsis

 

Here is an example:

http://dojo.telerik.com/OjUJI

 

The issues I'm experiencing:

 

1. When hovering over an element for the first time, an empty tooltip is displayed.

For example, hover over the OrderID column header right after clicking on the "Run" button. If you move the mouse out of the column header than back, no tooltip is displayed. I didn't expect an empty tooltip to be displayed for this element at all, even during the first mouse over.

 

2. Grid headers with ellipsis don't display a tooltip.

For example, hover over any of the last three columns.

I expected a tooltip to be displayed.

 

3. Not all grid cells with an ellipsis display a tooltip.

For example, hover over the cells with a "Ship Name" containing any of the following values:

a. Vins et alcools Cheva...

b. Victua... en stock

 

Thank you.

Dimitar
Telerik team
 answered on 30 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?