Telerik Forums
Kendo UI for jQuery Forum
1 answer
190 views

This has been asked before here: https://www.telerik.com/forums/kendo-validator---focus-on-first-invalid-field

However, the given solution does not work with a kendoTextBox. 

If you use the example given in the previous post (http://dojo.telerik.com/ukoLUJ/4?_ga=2.193348590.2100086651.1638809904-402941789.1637689930) and replace the inputs with kendoTextBoxes and update the libraries to the latest version, they will not gain focus when invalid.

Any help would be appreciated, thanks,

Kevin

Martin
Telerik team
 answered on 09 Dec 2021
1 answer
290 views
Hi team,

I'm using jquery spreadsheet wrapper on my React application. I wanted the autocomplete feature in the dropdown list of cell values. I found this thread useful.

I tried implementing http://dojo.telerik.com/AyOXo/3 (given in above thread), but in my case, the el.getKendoPopup(); is returning undefined and I'm clueless why this is happening.

I have attached an image for reference, dlg is undefined, and because of which dlg.setOptions() fails. Could you please help me resolve this?

Let me know if you need any other details.

Thanks!
Veselin Tsvetanov
Telerik team
 answered on 09 Dec 2021
0 answers
130 views

Hi Team,

We recently ran security scan on our web application which using "https://kendo.cdn.telerik.com/2020.2.513" Version.

and we encountered one scenario where Cross Site script executed even though we implemented encode and decode.

Scenari: User opens editor -> Clicks Insert Link Option.

We filled URL, Text inputs and for Tooltip fields we input Cross Site Script i.e (">">">"><script>alert(document.cookie);</script>)

and we clicked INSERT.

Basically the Tooltip field will break the anchor tag title parameter and script will execute.

Though we have implemented HTML encode and Decode we still experiencing this alert popup with cookie data while encode and Save and also Decode and Show.

 

Thanks In Advance.

Please let us know is there any inbuilt functionality in Kendo to handle this type of issue. 

 

 

Mark
Top achievements
Rank 1
 asked on 09 Dec 2021
3 answers
167 views

Greetıngs. I want to use Kendo jquery UI lazy loading structure and use drag and drop mechanism together. But here some problems arise. For example, files are duplicated when I drag and drop onto a node that hasn't been opened yet. When I manually set the "HasChildren" column, GetNode() runs automatically, resulting in two of the same file with data from the server. Please don't point me to the new version, I have to use this version. Thanks.

         

           function get(data, id) {
                if (id == 0) {
                    options.success([]);
                    return;
                }
                if (!id) {
                    return data;
                } else {
                    for (var i = 0; i < data.length; i++) {
                        if (data[i].id == id) {
                            return data[i].items;
                        } else if (data[i].items) {
                            var result = get(data[i].items, id);
                            if (result) {
                                if (result == null) {
                                    return null;
                                } else if (result.length == 0) {
                                    return null;
                                } else {
                                    return result;
                                }
                            }
                        }
                    }
                }
            }
            function getCurrent(data, id) {
                if (id == 0) {
                    options.success([]);
                    return;
                }
                if (!id) {
                    return data;
                } else {
                    for (var i = 0; i < data.length; i++) {
                        if (data[i].id == id) {
                            return data[i];
                        } else if (data[i].items) {
                            var result = getCurrent(data[i].items, id);
                            if (result) return result;
                        }
                    }
                }
            }

            function getTreeView() {
                return $("#treeview").data("kendoTreeView");
            }


            //For TreeView Lazy Loading
            var service = "/DijitalArsiv/GetNode/";
            let getData = new kendo.data.HierarchicalDataSource({
                transport: {
                    read: function (options) {

                        var currentId = options.data.id;
                        var child = get(TreeView, currentId);
                        var currentNode = getCurrent(TreeView, currentId);


                        if (child) {
                            options.success(child);
                        } else {

                            $.ajax({
                                url: service,
                                data: { "id": currentId, "isMainFolder": currentNode.isMainFolder, "path": currentNode.path },
                                contentType: "application/json; charset=utf-8",
                                dataType: "json",
                                async: false,
                                success: function (response) {
  
                                    var data = $.parseJSON(response);
                                    if (data.items != null) {

                                      options.success(data.items);

                                    }
                                    TreeView = getTreeView().dataSource.view();

                                }
                            }).fail(function (result) {
                                options.error(result);
                            });
                        }
                    }
                },
                serverFiltering: false,
                schema: {
                    model: {
                        id: "id",
                        isMainFolder: "isMainFolder",
                        isDraggable: "isDraggable",
                        isDroppable: "isDroppable",
                        hasChildren: "hasChildren"
                    }
                }
            });

            $("#treeview").kendoTreeView({
                template: kendo.template($("#treeview-template").html()),
                dataSource: getData,
                dragAndDrop: true,
                loadOnDemand: true,
                dragend: function (event) {

                },
                drop: function (event) {

                    var localTreeView = getTreeView();
                    var movingItem = localTreeView.dataItem(event.sourceNode);
                    var destinationItem = localTreeView.dataItem(event.destinationNode);
                    var movingItemParent = localTreeView.dataItem(localTreeView.parent(event.sourceNode));

                    if (!event.valid) {
                        event.setValid(false);
                        return;
                    }

                    if (movingItem != null && destinationItem != null) {

                        if (destinationItem.id == movingItemParent.id) {
                            event.setValid(false);
                            return;
                        }

                        if (!movingItem.isDraggable) {
                            event.setValid(false);
                            return;
                        }

                        if (!destinationItem.isDroppable) {
                            event.setValid(false);
                            return;
                        }

                        if (destinationItem.spriteCssClass != "folder") {
                            event.setValid(false);
                            return;
                        }

                        if (event.dropPosition == "after" || event.dropPosition == "before") {
                            event.setValid(false);
                            return;
                        }

                               
                        FileTransfer(movingItem, destinationItem);
                      

                    } else {
                        event.setValid(false);
                        return;
                    }

                },
                select: function (event) {
                    var node = $("#treeview").getKendoTreeView().dataItem(event.node);
                    $(".nodeIconGroup").css("display", "none")
                    $("#"+node.uid).css("display", "inherit")

                }

            })                                                                

           function FileTransfer(movingItem, destinationItem) {

                destinationItem.hasChildren = true;

                $.ajax({
                    url: "/DijitalArsiv/FileTransfer/",
                    data: { "movingItemID": movingItem.id, "movingPath": movingItem.path, "movingFileName": movingItem.text, "movingFileType": movingItem.spriteCssClass, "destinationItemID": destinationItem.id, "destinationPath": destinationItem.path, "destinationIsMainFolder": destinationItem.isMainFolder },
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    async: true,
                    success: function (response) {
                        if (response.Status) {
                            movingItem.path = response.destinationPath;
                        } else {
                            getTreeView().dataSource.data(FirstData);
                            TreeView = JSON.parse(JSON.stringify(FirstData));
                        }
                    }
                }).fail(function (result) {

                });

            }

 

Neli
Telerik team
 answered on 09 Dec 2021
1 answer
94 views

Hello,

I used the code to use the br tag instead of the p tag.

defaultTools.insertLineBreak.options.shift = false;
defaultTools.insertParagraph.options.shift = true; 

A new line is marked br tag.

but when I enter and enter the styled text(bold etc), the enter format disappears.
How can I fix it in the 2017 version?

https://dojo.telerik.com/ANaGUDAT


Neli
Telerik team
 answered on 09 Dec 2021
1 answer
754 views

Hi,

I am currently integrating the Tree View & context menu in Kendo UI Jquery. I would need to show different set of context menus for different category. Is there a way to do it? For 1st & 2nd level will be different context menu. 3rd level will not have any context menu.

 

Thanks in advance.

Neli
Telerik team
 answered on 09 Dec 2021
1 answer
166 views

Due to some reason data is not binding if I add "resources" in scheduler.

Please find the attachments for code and result.

Neli
Telerik team
 answered on 08 Dec 2021
0 answers
974 views
I would like to make the switch smaller (height especially) without changing the theme.  Is this possible?  Thanks.  
Sean
Top achievements
Rank 1
 asked on 08 Dec 2021
1 answer
144 views

Hi Team,

is there any way to use keyboard while the color picker is open for background color in rich text editor

Neli
Telerik team
 answered on 07 Dec 2021
1 answer
407 views

I copied the demonstration code and controller ( from GitHub) and slightly modified to suit.

The view is very simple

<body>
    <div id="example">
        <div id="filemanager"></div>

        <script>
        $("#filemanager").kendoFileManager({
            dataSource: {
                schema: kendo.data.schemas.filemanager,
                transport: {
                    read: {
                        url: '@Url.Action("Read", "FileManager")',
                        method: "POST"
                    }
                }
            },
            toolbar: {
                items: [
                    { name: "createFolder" },
                    { name: "upload" },
                    { name: "sortDirection" },
                    { name: "sortField" },
                    { name: "changeView" },
                    { name: "spacer" },
                    { name: "details" },
                    { name: "search" }
                ]
            },
            contextMenu: {
                items: [
                    { name: "rename" },
                    { name: "delete" }
                ]
            },
            draggable: true,
            resizable: true
        });

        $(document).ready(function () {
            var filemanager = $("#filemanager").getKendoFileManager();

            filemanager.executeCommand({ command: "TogglePaneCommand", options: { type: "preview" } });
            filemanager.toolbar.fileManagerDetailsToggle.switchInstance.toggle();
        })
        </script>
    </div>




</body>
</html>


The Data returned from the controller is this ( copy and paste from the browser)

[{"name":"English","size":0,"path":"English","extension":"","isDirectory":true,"hasDirectories":false,"created":"\/Date(1638409250788)\/","createdUtc":"\/Date(1638409250788)\/","modified":"\/Date(1638834574019)\/","modifiedUtc":"\/Date(1638834574019)\/"},{"name":"Swedish","size":0,"path":"Swedish","extension":"","isDirectory":true,"hasDirectories":false,"created":"\/Date(1638409251098)\/","createdUtc":"\/Date(1638409251098)\/","modified":"\/Date(1638501536659)\/","modifiedUtc":"\/Date(1638501536659)\/"}]

I have tried viewing a folder with lots of file.. the number of File is always right.. but something is going wrong with the reading of the data being returned The initial controller code I used set path as a path and filename. I changed it to above to match what I can see returning for the examples provided.
So  now I believe the JSON being returned from the online samples that are using the same backend are identical to what I am returning. 

I am using 2021.1.330.     The only thing I can think of is that there was a change in the Schema between versions? But I cannot find anything about this

I haven't got much hair left these days... would really appreciate a pointer to at least what I could be checking.

Many thanks

Rob

Rob
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 07 Dec 2021
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
Effects
Accessibility
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
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
+? 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?