Telerik Forums
Kendo UI for jQuery Forum
4 answers
1.0K+ views

Our software uses both Telerik WPF editors and Kendo editors, and we transfer the HTML back and forth from these editors.  The WPF editors export the HTML, and that HTML is loaded into the Kendo editor.  One of the problems we encountered is that table cell (td) padding and borders are not showing up in the Kendo editor when loaded.  The reason is that there appears to be a block of styles that always appears in the editor doc head, and these styles are overriding the class styles of the tables.

Here is the block of styles that gets inserted into the editor head (appears to come from the javascript:

<html lang="en"><head><meta charset="utf-8"><title>Kendo UI Editor content</title><style>html{padding:0;margin:0;height:100%;min-height:100%;cursor:text;}body{padding:0;margin:0;}body{box-sizing:border-box;font-size:12px;font-family:Verdana,Geneva,sans-serif;margin-top:-1px;padding:5px .4em 0;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}p{margin:0 0 1em;}.k-marker{display:none;}.k-paste-container,.Apple-style-span{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}ul,ol{padding-left:2.5em}span{-ms-high-contrast-adjust:none;}a{color:#00a}code{font-size:1.23em}telerik\3Ascript{display: none;}.k-table{width:100%;border-spacing:0;margin: 0 0 1em;}.k-table td{min-width:1px;padding:.2em .3em;}.k-table,.k-table td{outline:0;border: 1px dotted #ccc;}.k-table th{outline:0;border: 1px dotted #999;}.k-table p{margin:0;padding:0;}.k-column-resize-handle-wrapper {position: absolute; height: 10px; width:10px; cursor: col-resize; z-index: 2;}.k-column-resize-handle {width: 100%; height: 100%;}.k-column-resize-handle > .k-column-resize-marker {width:2px; height:100%; margin:0 auto; background-color:#00b0ff; display:none; opacity:0.8;}.k-row-resize-handle-wrapper {position: absolute; cursor: row-resize; z-index:2; width: 10px; height: 10px;}.k-row-resize-handle {display: table; width: 100%; height: 100%;}.k-row-resize-marker-wrapper{display: table-cell; height:100%; width:100%; margin:0; padding:0; vertical-align: middle;}.k-row-resize-marker{margin: 0; padding:0; width:100%; height:2px; background-color: #00b0ff; opacity:0.8; display:none;}.k-table-resize-handle-wrapper {position: absolute; background-color: #fff; border: 1px solid #000; z-index: 100; width: 5px; height: 5px;}.k-table-resize-handle {width: 100%; height: 100%;}.k-table-resize-handle.k-resize-east{cursor:e-resize;}.k-table-resize-handle.k-resize-north{cursor:n-resize;}.k-table-resize-handle.k-resize-northeast{cursor:ne-resize;}.k-table-resize-handle.k-resize-northwest{cursor:nw-resize;}.k-table-resize-handle.k-resize-south{cursor:s-resize;}.k-table-resize-handle.k-resize-southeast{cursor:se-resize;}.k-table-resize-handle.k-resize-southwest{cursor:sw-resize;}.k-table-resize-handle.k-resize-west{cursor:w-resize;}.k-table.k-table-resizing{opacity:0.6;}.k-placeholder{color:grey}k\:script{display:none;}</style>

 

Here is an example of a TD that is part of our HTML being loaded:

<td class="tc_8D184ABE" align="left" valign="top" data-role="resizable"><p class="Normal p_A43897F6"><span>Some text</span></p></td>

 

And the class styles:

.tc_8D184ABE { telerik-style-type: local;border-left: 12px double #548ED5;border-top: 12px double #548ED5;border-right: 12px double #548ED5;border-bottom: 12px double #548ED5;padding: 4px 12px 4px 12px;width: 189.466674804688px;vertical-align: top; }

 

Since the .k-table td style in the head block overrides the class styles, the borders and the padding do not render.  Is there any suggestions for getting around this issue?

Thanks for any help.

 

 

 

 

Petar
Telerik team
 answered on 12 May 2020
9 answers
1.0K+ views

Attached my code.

Its working fine as expected.

But while i am exporting to excel, the child rows are not showing. because in datasource field i made "Comments" field as hidden. If i remove "hidden" then data is exporting as expected. But i dont want to show this Comments field as parent record.

I tried to use showColumn/hideColumn as mentioned in code. but its not working as expected. Looking your help on this.

 

Tsvetomir
Telerik team
 answered on 12 May 2020
5 answers
1.9K+ views
Is there a way to set the optionLabel after the initiation, because I want it to be dependent on the value of the data.
If there is no data I want my users to know, that there are no options anymore.

Otherwise I just do a jquery.html() on that element. But it would be nice if I can set it with the API
Sivaramakrishna Reddy
Top achievements
Rank 1
Veteran
 answered on 12 May 2020
3 answers
211 views

I am using your demo site for the Kendo editor.  I created a 4x2 table in the editor.  I then merged the first two cells horizontally, and the last two cells vertically.  I then changed some borders and set the table cell spacing in the wizard.  As I keep changing things, I see new cells get created unexpectedly.  We see this same behavior in our products.

This should be a 4x2 table:

 

 

Aleksandar
Telerik team
 answered on 11 May 2020
6 answers
145 views

I have a data grid with 5 fields and popup Add and Edits defined - see image001.jpg

One of the fields 'Template Name' is defined as display only (editor : displayOnly) because it has already been selected on the previous dialog

On the Edit popup it is shown - see image005.jpg

On the Add popup it is not shown (there is a small circle) - see image006.jpg

 

The users want it to be shown on both Add and Edit, as it is confusing

 

 

Alex Hajigeorgieva
Telerik team
 answered on 11 May 2020
11 answers
467 views

Hi,

I'm trying to add the new kendo rating control in a grid template column. When using percision=half, the last selected item is with hidden star. .

You can check it in this dojo - https://dojo.telerik.com/@bzpetkov/OburapiH

Otherwise, if the percision is full, everything is as expected. 

Please advise. Thanks, Boyan.

Boyan
Top achievements
Rank 1
 answered on 11 May 2020
6 answers
923 views
I have a grid in which I want to bind the generated columns inside the foreach-loop (currently set to "Number") to the dictionary entry of e.Key. The code below works, but I have the problem that I need the sorting functionality of the column menu to sort by the dictionary entry. In the current code I get the Bound "Number" as field to sort by, but I need the dictionary key.
 
@(Html.Kendo().Grid<Bauteil>()
                .Name("PartSearchGrid")
                .Resizable(resize => resize.Columns(true))
                .Sortable()
                .ClientDetailTemplateId("detailtemplate")
                .PersistSelection(true)
                .Selectable(selectable => selectable
                .Type(GridSelectionType.Row)
                .Mode(GridSelectionMode.Single)
                )
                .ToolBar(tools =>
                {
                    tools.Custom().Text("<input id='partsearchbox' onkeyup='onSearch()' placeholder='" + GuiLabel["Label_Search"].Value + "' />");
                    tools.Excel();
                    tools.Custom().Text("Reset").HtmlAttributes(new { onclick = "resetFilter()" });
                })
                .Pageable(pageable => pageable
                .PageSizes( new[] { 10, 20, 50, 100, 500, 1000 })
                .Enabled(true)
                .Numeric(true)
                )
                .Scrollable(s => s.Virtual(GridVirtualizationMode.Rows))
                .Columns(columns =>
                {
                    columns.Bound(p => p.Number).Width(100);
                    columns.Bound(p => p.Name).Width(100);
                    columns.Bound(p => p._calcNoOfProcesses).Width(100);
 
                    foreach (Meta_PlanningProfileEntry e in Model.Part_Profile_Entries)
                    {
                        columns.Bound("Number").ClientTemplate("# if (PlanningDataDict[\"" + e.Key + "\"] != null) { #" + "<p>#= PlanningDataDict[\"" + e.Key + "\"] #</p>" + "# } else { #" + "" + "# } #").Width(100);
                    }
                    columns.Bound(p => p.StateString).Width(100);
                })
                .Excel(excel => excel
                .FileName("TP_Parts_Export.xlsx")
                .AllPages(true)
                )
                .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(50)
                .ServerOperation(true)
                .Model(model =>
                {
                    model.Id(m => m.ID);
                })
 
                .Read(r => r.Action("Parts_Read", "Part").Data("getPartFilters"))
                )
                .ColumnMenu()
                )
Tsvetomir
Telerik team
 answered on 08 May 2020
7 answers
215 views

Hello Everyone,

I'm using kendo.ui.Window in my project which is run on mobile,

the window widget default is opened as maximum, it's perfect when the device is vertical,

but when I rotate the device to horizontal, sometimes it work fine, but sometimes the window widget is not full fill the screen, it will display like this

https://drive.google.com/open?id=1Wgl81bXRdFSwtSU5lebVWdNSoiAZajPH

is it possible to solve this problem programmatically?

 

here is my code: 

var myWindow = $('#chart-dialog');
myWindow.kendoWindow({
    width: 450,
    title: "QC Trend Chart - Test No:",
    visible: false,
    closable: false,
    modal: false,
    content: '',
    actions: [
        "Close"
    ],
});

 

Thanks for your help !!

David
Top achievements
Rank 1
 answered on 08 May 2020
3 answers
198 views

Trying to disable worksheet tab reordering but no dice. I've tried listening for dragstart using jquery as well as attaching kendoDraggable to the .k-item elements of my spreadsheet but drag event's don't seem to be raised when reordering tabs. 

 

                $("ul.k-tabstrip-items .k-item").kendoDraggable({
                    dragstart: function (e) {
                        return false; //tried e.preventDefault() as well
                    },
                    dragend: function (e) {
                        return false;
                    }
                });

Any suggestions would be appreciated.

Petar
Telerik team
 answered on 07 May 2020
4 answers
1.4K+ views

 

 

 

 

 

 

 

this.taskGridOptions = {
        data: self.tasks,
        scrollable: false,
        sortable: true,
        persistSelection: true,
        selectable: "row",
        change: function (grid) {
            console.debug("Change grid...");
            self.checkForCheckedRows();
        },
        dataBound: function () {

            this.table.find(".checked-row").click(function () {
                var checked = this.checked;
                var grid = $("#taskGrid").data("kendoGrid");
                // Find the row that was checked
                row = $(this).closest("tr"),

                    // Set the data item's IsSelected property
                    dataItem = grid.dataItem(row);
                dataItem.IsSelected = checked;

                var realItem = ko.utils.arrayFirst(self.tasks(), function (item) {
                    if (item.Id() == dataItem.Id) {
                        return true;
                    }
                });

                // And set it's IsSelected property (this field isn't bound)
                if (realItem)
                    realItem.IsSelected = checked;

                // Update the text alerting how many have been checked
                self.checkForCheckedRows();

                // debug
                console.debug(JSON.stringify(self.tasks()));
            });
        },
        noRecords: {
            template: "<div class='no-grid-data'> 'No records found, please refine your search.'</span>"
        },
        pageable: {
            pageSize: 20
        },
        columns: [
            {
                headerTemplate: "<input id='check-all-box', type='checkbox', class='check-box' />",
                field: "IsSelected",
                type: "boolean",
                width: 45,
                sortable: false,
                template: "<input type='checkbox' class='checkbox checked-row' />",
            },
            { field: "Id", title: "Task Id" },
            { field: "TicketId", title: "Ticket Ref" },
            { field: "LeadId", title: "Lead Id" },
            {
                field: "UserId", title: "User",
                template: function (data) {
                    return self.getUsernameByUserId(data.UserId);
                }
            },
            {
                field: "ResultCodeId", title: "Result Code",
                template: function (data) {
                    return self.getResultcodeById(data.ResultCodeId);
                }
            },
            {
                field: "DueDate", title: "Due Date",
                template: function (data) {
                    return parseJsonDate(data.DueDate).toLocaleString();
                }
            },

            {
                field: "Status", title: "Task Status",
                template: function (data) {
                    if (data.Status == InteractionStatusType.Closed)
                        return "Closed";
                    else if (data.Status == InteractionStatusType.InProgress)
                        return "In Progress";
                    else if (data.Status == InteractionStatusType.Open)
                        return "Open";
                }
            },
            {
                field: "ChannelType", title: "Channel Type",
                template: function (data) {
                    if (data.ChannelType == InteractionTypes.Call)
                        return "Call";
                    else if (data.ChannelType == InteractionTypes.Email)
                        return "Email";
                    else if (data.ChannelType == InteractionTypes.Chat)
                        return "Chat";
                }
            },
            {
                command: { text: "View Details", click: showDetails, title: " ", width: "180px" },
            }
        ]
    }
    
    function wnd() {
        $("#details")
        .kendoWindow({
            title: "Customer Details",
            modal: true,
            visible: false,
            resizable: false,
            width: 300
        }).data("kendoWindow");
    }
    detailsTemplate = kendo.template($("#template").html());

    function showDetails(e) {
        e.preventDefault();

        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
        wnd.content(detailsTemplate(dataItem));
        wnd.center().open();
    }

 

<script id="template" type="text/x-kendo-template">
    <div id="taskInfo-dialog">
        <label class="form-label">
            Subject:
            <span>#=Description#</span>
        </label>
        <label class="form-label">
            Notes:
            <span>#=Notes#</span>
        </label>
    </div>
</script>

Plamen | Lead Technical Support
Telerik team
 answered on 06 May 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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
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
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?