Telerik Forums
Kendo UI for jQuery Forum
5 answers
1.2K+ views
Hello, 
I have to substitute the AjaxControlToolkit.HTMLEditor with a Kendo Editor, maintaining more or less the same functionalities.I have problems to reproduce the functionalities provided by the buttons "Cut/Copy/Paste".
THINGS WORK OKAY if what I copy/paste is pure text. How can I maintain the formatting tags as color, numbered list, etc ?

Since the keys Ctrl-C and Ctrl-V work I thought it would be easier to reproduce the same behavior but I'm not able to.  In Kendo_web.js somehow this is achieved though.
A kendo forum "Copy text from Office to Editor"suggested to disable the pasting handler as
function onPaste(e) {
var editor = $("[data-role=editor]").data("kendoEditor");
$(editor.body).off("paste");
}
but it didn't work for me.
Basically this is the code I use in a .js file
I call my editor "myeditor" declared as a text area, I added three custom buttons as cut, copy, paste
$("#myeditor").kendoEditor({
            tools: [
                {
                    name: "customcut",
                    tooltip: "Cut the selection",
                    exec: function (e) {
                        var editor = $(this).data("kendoEditor");
                        range = editor.getRange();
                        seltext = editor.selectedHtml();
                        window.clipboardData.setData("Text", seltext);
                        range.deleteContents();
                    }
                },
                {
                    name: "customcopy",
                    tooltip: "Copy to clipboard",
                    exec: function (e) {
                        myeditor.encodedValue();
                        seltext = myeditor.selectedHtml();
                        window.clipboardData.setData("Text", seltext);
                    }
                },
                {
                    name: "custompaste",
                    tooltip: "Paste from clipboard",
                    exec: function (e) {
                        var wclip = window.clipboardData.getData("Text");
                        if (wclip.length > 0) {
                            myeditor.paste(wclip);
                        }
                    }
                }
            ],  //end tools[]
            change: onChange,
            select: onSelect,
            execute: onExecute,
            paste: onPaste
        });

I believe I don't know how to access the clipboard properly.
Sorry for the long text, I will be very grateful for any help

MarcoF
Joana
Telerik team
 answered on 30 Apr 2019
1 answer
148 views

I have two datasource, how to achieve overlay one datasource to another datasource bar like in this example https://docs.telerik.com/kendo-ui/knowledge-base/chart-overlay-bar-series

 

Konstantin Dikov
Telerik team
 answered on 30 Apr 2019
3 answers
1.5K+ views
I have a grid defined like this...

<div id="view">
    <div id="grid" data-role="grid"
        data-editable="false"
        data-columns="[{ 'field': 'Name' }, { 'field': 'Version'}]"
        data-bind="source: releases">
    </div>
</div>

and a view model defined so...

var viewmodel = kendo.observable({
    releases: new kendo.data.DataSource({
        schema: {
            model: {
                id: "Id",
                fields: {
                    Id: { type: "string" },
                    Name: { type: "string" },
                    Version: { type: "string" },
                    CreatedOn: { type: "datetime" }
                }
            }
        },
        transport: {
            read: {
                url: "/Release/Index?handler=List",
                type: "jsonp"
            }
        }
    })
});

 

When I try and render the page, the controls show, but there is no data, instead I get a 400 error. More reading tells me about anti-forgery tokens and how to set the header on my post request, so I add this to the top of my page....

@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery Xsrf


And, I set the header for the call with the anti forgery token, with this in my client side code...

$(function () {
    const requestVerificationToken = '@Xsrf.GetAndStoreTokens(HttpContext).RequestToken';
    const beforeSend = req => req.setRequestHeader('RequestVerificationToken', requestVerificationToken);
    const grid = $("#grid").getKendoGrid();
    grid.dataSource.transport.options.read.beforeSend = beforeSend;
 
    grid.data.read();
});


Now when I call my page, I get "Cannot read property 'read' of undefined."

Everything I've read suggests that I'm doing it right!

What am I not doing?

Tsvetomir
Telerik team
 answered on 30 Apr 2019
3 answers
529 views
How to show  two months in kendo datepicker? 
Dimo
Telerik team
 answered on 29 Apr 2019
4 answers
641 views
Hi,

 I want to add a global error handler that gets called when any AJAX call made by a Kendo control fails. So I have a kendo window opening as a popup that has a grid that has regular methods like read, update. It has url's pointing to WCF services. Now I want to catch errors in my global handler that may come from my WCF calls. I tried using $.ajaxerror but its not getting called for kendo calls, for others its working. I also tried the following code but it didnt work:
kendo.data.DataSource.prototype.options.error = function (e) {
            //your logic
            alert('kendo error');
        };

So can you please point to me how to add global error handler for my ajax calls from kendo controls.
Thanks in advance.
Jon
Top achievements
Rank 1
 answered on 26 Apr 2019
10 answers
605 views

Are there any updates on this topic ? Since I am using Kendo UI slider with razor view having version 2017.2.621.545 and I am not able to get it works in mobile devices specially on iPhone.
The code is as follows - 
 @(Html.Kendo().SliderFor(m => m.PercentChanceClose)
                        .Name("PercentChanceClose")
                        .ShowButtons(true)
                        .Tooltip(true)
                        .Max(100)
                        .Min(0)
                        .SmallStep(5)
                        .LargeStep(10)
                        .Events( e => e.Change("SliderChange"))
                        .IncreaseButtonTitle("Perecent(%) Chance Close")
                        .HtmlAttributes(new { @class = "form-control"})
                        )

JavaScript function - 

 function SliderChange(e) {

        if (e== null) {
            SliderValue(50);
        }
        else {
            SliderValue(e.value);
        }

    }


    function SliderValue(x) {
        var top = $("#PercentChanceClose").closest(".k-slider-wrap");

        if (x >= 0 && x <= 24) {
            $(".k-slider-track", top).css("background-color", "#00ff00");
            $(".k-slider-selection", top).css("background-color", "#00ff00");
          }
        else if (x >= 25 && x <= 74) {
            $(".k-slider-track", top).css("background-color", "#ffa500");
            $(".k-slider-selection", top).css("background-color", "#ffa500");
        }
        else {
            $(".k-slider-track", top).css("background-color", "#ff0000");
            $(".k-slider-selection", top).css("background-color", "#ff0000");
        }
    }

 

Dimitar
Telerik team
 answered on 26 Apr 2019
8 answers
4.2K+ views
Is it possible to override the confirmation on Kendo Grid : editable ?

In generally I'd always avoid javascript alert/confirm. It's just a noisy and terrible default behaviour :)
Jeremy
Top achievements
Rank 1
 answered on 26 Apr 2019
8 answers
1.7K+ views

I've created a simple Odata service that reads the contents of a single local SQL table. My service works correctly, I've checked in Postman, but the Kendo UI grid throws the following error:

Uncaught TypeError: Cannot read property '__count' of undefined

 

I checked entries on the board, and I've seen several that refer to the version of Odata. They imply that you need to use an older version of OData to work with the grid.  The version I'm using is v4.0.30319. Will this version work with Kendo UI grid? Or does the error point to something else?

 here's my html:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="styles/kendo.common.min.css" rel="stylesheet" />
<link href="styles/kendo.default.min.css" rel="stylesheet" />
<script src="js/jquery.min.js"></script>
<script src="js/kendo.all.min.js"></script>
</head>
<body>
<div id="example">
<div id="grid"></div>
<script>
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: "//localhost:49666/CustomerComplaintDataService.svc/Complaints"
},
schema: {
model: {
fields: {
RecordNumber: { type: "number" },
Date: { type: "date" },
Brand: { type: "string" },
Filter_part_number: { type: "string" },
PlantMfrgLoc: { type: "string" },
Date_code: { type: "string" },
Person_talked_to: { type: "string" },
Phone_number: { type: "string" },
Company_Name: { type: "string" },
Product_Complaint: { type: "string" },
Action_taken: { type: "string" },
Results: { type: "string" },
Call_taken_by: { type: "string" },
Customer_Required_Response: { type: "string" },
Risk_Level: { type: "string" }
}
}
},
pageSize: 20,
serverPaging: true,
serverFiltering: true,
serverSorting: true
},
height: 550,
filterable: true,
sortable: true,
pageable: true,
columns: [{
field: "RecordNumber",
filterable: false
},
"Brand",
{
field: "Date",
title: "Date",
format: "{0:MM/dd/yyyy}"
}, {
field: "Product_Complaint",
title: "Product Complaint"
}, {
field: "Action_taken",
title: "Action Taken"
}
]
});
});
</script>
</div>
</body>
</html>

 

Thanks in advance,

 

Mark

 

Preslav
Telerik team
 answered on 26 Apr 2019
3 answers
267 views

Hello, I have a Menu widget as a child of a Toolbar.  I am disabling the menu using the following code:

myToolbar.enable(myMenu, false);

This correctly shows the menu widget as disabled (i.e. it's grayed out), but when I click the menu, it is still displaying the drop down menu under the button.  Shouldn't calling enable with a value of false cause click events to be ignored?  How can I accomplish this?

Thanks in advance

David

Petar
Telerik team
 answered on 25 Apr 2019
2 answers
120 views
The example found on the documentation to change to a custom background marker does not work. https://docs.telerik.com/kendo-ui/controls/diagrams-and-maps/map/how-to/custom-markers is not working as the background image, https://demos.telerik.com/kendo-ui/content/shared/images/we-are-here.png, does not exist (404 error).
gregory
Top achievements
Rank 1
 answered on 23 Apr 2019
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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
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
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
AICodingAssistant
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?