Telerik Forums
Kendo UI for jQuery Forum
1 answer
188 views

I have this simple tabStrip

var tabStrip = $("#tabstrip").kendoTabStrip({
  dataSource: [
    { text: 'Tab1', url: '' },
    { text: 'Tab2', url: '' },
    { text: 'Tab3', url: '' },
    { text: 'Tab4', url: '' }
  ],
  dataTextField: 'text',
  dataUrlField: 'url'
}).data("kendoTabStrip");

 

Let's do two transformations on it

// Move Tab4 before Tab1
tabStrip.insertBefore(tabStrip.tabGroup.children().last(), tabStrip.tabGroup.children().first());
// Remove Tab3
tabStrip.remove("li:last");

 

If I look at the dataSource of my tabStrip, I don't see the above transformations.

// Expected: [{"text":"Tab4","url":""},{"text":"Tab1","url":""},{"text":"Tab2","url":""}]
// Result: [{"text":"Tab1","url":""},{"text":"Tab2","url":""},{"text":"Tab3","url":""},{"text":"Tab4","url":""}]   
kendo.stringify(tabStrip.dataSource.data());

 

How can I keep the dataSource in sync with what is actually rendered?

Here is a dojo snippet reproducing my issue.

Regards

Nencho
Telerik team
 answered on 17 Jul 2020
1 answer
946 views

Hi,

Can anyone help me out here for, how to add watermark/logo/disclaimer in kendo export to excel from grid.

below code snippets for reference which i am using currently:

Grid UI:

<div class="panel panel-default">
<div class="panel-heading position-relative border-0">
@Html.DisplayNameFor(m => m.ClSearchResultTitle)
<div class="btn-right">
<button class="btn btn-primary btn-sm" id="btnExportToPdf"><i class="fa fa-file-pdf-o"></i></button>
<button class="btn btn-primary btn-sm" id="btnExportToExcel"><i class="fa fa-file-excel-o"></i></button>
<button class="btn btn-primary btn-sm" id="btnPrint"><i class="fa fa-print"></i></button>
</div>
</div>

@(Html.Kendo().Grid<PracticeLinkWebServices.ViewModel.AdminViewModel.AimImportSummaryViewModel>
().EnableCustomBinding(true)
.Name("GridDetails")
.ToolBar(tools => tools.Pdf())
.Pdf(pdf => pdf.AllPages().AvoidLinks().Title("AIMImportSummary").PaperSize("A4").Scale(0.8).Margin("2cm", "1cm", "1cm", "1cm").Landscape().RepeatHeaders().TemplateId("page-template").FileName("AIMImportSummary.pdf"))
.ToolBar(tools => tools.Excel()).Excel(excl => excl.AllPages(true).FileName("AimImportSummary.xlsx"))
.Events(e => e.PdfExport("PdfExportEvent"))
.Columns(columns =>
{
columns.Bound(p => p.EventDate).Width(150).Title(StaticHelpers.GetAdminResourceByTitles("Admin_AimImportSummary_GrdContentGrid_EventDate")).ClientTemplate("#=FormattedEventDate#").HtmlAttributes(new { @class = "text-center" }).HeaderHtmlAttributes(new { style = "text-align:center" });
columns.Bound(p => p.PageName).Width(150).Title(StaticHelpers.GetAdminResourceByTitles("Admin_AimImportSummary_GrdContentGrid_PageName"));
columns.Bound(p => p.CountPl).Width(150).Title(StaticHelpers.GetAdminResourceByTitles("Admin_AimImportSummary_GrdContentGrid_PLCount")).ClientTemplate("#= FormattedPlCountAction#");
columns.Bound(p => p.CountAnonymous).Width(150).Title(StaticHelpers.GetAdminResourceByTitles("Admin_AimImportSummary_GrdContentGrid_CountAnonymous")).ClientTemplate("#= FormattedAnonymousCountAction#");

columns.Template(p => p.PageName).Width(150).Title(StaticHelpers.GetAdminResourceByTitles("Admin_AimImportSummary_GrdContentGrid_Action")).ClientTemplate("<div class='admin-btn-edit'><a href='" + Url.Action("AimSummaryDetail", "Content", new { eventDate = "#= FormattedEventDate#", pageId = "#= PageId#", url = "#= Url#", email = "#= Email#", clientId = "#= MemberId#", recordType = "#= RecordType#",jobId="#= JobId#" }) + "' title=\"" + "View Summary Detail" + "\">" + "<i class='fa fa-pencil-square-o'></i>" + "</a></div>").Width(50).HtmlAttributes(new { @class = "text-center" }).HtmlAttributes(new { @class = "text-center" });

}).Pageable(pageable => pageable.Refresh(true).PageSizes(AppConstants.PageSizeValues).ButtonCount(5)
.Messages(msg => msg.Display(AppConstants.GridPagerMessage.Replace("[]", "AIM Import Summary.")))
)
.Sortable().Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple).Type(GridSelectionType.Cell)).AutoBind(false)
.ColumnMenu(c => c.Enabled(AppConstants.ShowColumnMenu)).DataSource(dataSource => dataSource.Ajax().Sort(x => x.Add("EventDate").Descending()).Events(e => e.Error("RedirectToError").RequestEnd("onRequestEnd"))
.Read(read => read.Action("AimImportSummaryGrid", "Content").Data("SearchCriteria"))
.Total((int)@Model.RecordCount).PageSize(AppConstants.DefaultPageSize)
.ServerOperation(true)
.Model(a => a.Id(p => p.PageId)))
.NoRecords(x => x.Template(AppConstants.NoRecordsFoundText))
.Resizable(resize => resize.Columns(true))
.Reorderable(reorder => reorder.Columns(true))
)

<div class="no-results">@Html.DisplayNameFor(m => m.ClSumitSerach)</div>
<script type="x/kendo-template" id="page-template">
<div class="page-template">
<div class="header">
@Html.HtmlLabelFor(x => x.ClSearchTitle)
</div>
</div>
</script>
</div>


Jquery:

$('#btnExportToExcel').on('click', function () {
    $('#GridDetails').find('.k-grid-toolbar').find('.k-grid-excel').trigger('click');
});
Veselin Tsvetanov
Telerik team
 answered on 17 Jul 2020
5 answers
342 views
I need to print the kendo grid result from client side,
I have the result on the client and I do not want to go back to the server, 
You have a way to do this?
Dimitar
Telerik team
 answered on 17 Jul 2020
1 answer
406 views

Hi,

Can anyone help me out here for my situation, how can i add logo and disclaimer on the every page bottom while doing print of kendo grid result set.

Thanks in advance!

Dimitar
Telerik team
 answered on 17 Jul 2020
2 answers
250 views

Hello,

 

I am looking for help regarding preventing a kendo spreadsheet from executing html that is pasted into a cell.  I have tried $(document).on('paste', function () {}) and the kendo paste function prevent defaults, but neither or these worked.  Any suggestions?

Example:

Dojo: https://dojo.telerik.com/AjomeMOH/5

Paste value : <img src=x onerror=alert(123)>

 

Thanks

Ivan Danchev
Telerik team
 answered on 16 Jul 2020
3 answers
393 views

Hello,

        How to use Component Type in datetime picker MVVM? i tried using data-component-type="modern" , but it didnt worked 

Georgi
Telerik team
 answered on 16 Jul 2020
4 answers
537 views

Hi!

I have been scouring through the forums and documentation but the way a grid gets tooltip is very confusing to me. we need to have a separate tooltip control and traverse the grid and apply tooltip in it.

Is there a way such as:

01.columns: [ {
02.        field: "ParkingCardId",
03.        title: "Card Id",
04.        template: '<a href="@Url.Action("NewRequest", "Parking")?cardId=#=ParkingCardId#&cardTypeString=View">#=ParkingCardId#</a>'
05.    }, {
06.        field: "DateRequested",
07.        title: "Requested",
08.        template: '#= kendo.toString(kendo.parseDate(DateRequested), "dd-MMM-yy")#'
09.    }, {
10.        field: "Name",
11.        title: "Full Name"
12.    }, {
13.        field: "AirportPassNumber",
14.        title: "Pass No."
15.    }, {
16.        field: "DrivingLicenseNumber",
17.        title: "D.L No"
18.    }, {
19.        field: "VehicleNumber",
20.        title: "Car No."
21.    }, {
22.        field: "Status",
23.        title: "Status"
24.        tooltip: "<Name of a property on the model>"
25.    }, {
26.        field: "PassExpiryDate",
27.        title: "Expiry Date",
28.        template: '# if (PassExpiryDate !== null) {# #=kendo.toString(kendo.parseDate(PassExpiryDate), "dd-MMM-yy")# #} else { # <span></span> # } #'
29.    }, {
30.        field: "StatusId",
31.        title: "Action",
32.        template:
33.            "#if (IsExpired && StatusId === 5) {# <a href='@Url.Action("NewRequest", "Parking")?cardId=#=ParkingCardId#&cardTypeString=Renew Card'>Renew</a> #} else {# #}#" +
34.            "#if ((IsExpired && StatusId === 5) && StatusId === 0) {# | #} else {# #}# " +
35.            "#if (StatusId === 0) {# <button type='button' class='k-button k-danger' onclick='openCancelDialog(#=ParkingCardId#)'>Cancel</button> #} else {# #}#"
36.    },{
37.        field: "Invoice",
38.        title: "Invoice",
39.        template: '#if (Status == "Print & Pay") {# <a onclick=PrepareInvoice("#=ParkingCardId#")>Print</a> #} else {# #}#'
40.    }
41.]

 

Check line # 24.

Neli
Telerik team
 answered on 16 Jul 2020
1 answer
84 views
I searched about this a lot and I'm confused.
I'm a beginner web developer and I'm about to finish Javascript's basics, I will go to libraries and stuff like that
So I want your answer, do I need to learn Jquery or just use Javascript DOM?
I heard that Jquery is outdated and is getting ditched in favor of React so I'm confused right now.
Aleksandar
Telerik team
 answered on 15 Jul 2020
9 answers
205 views

Telerik,

As per your article here - https://docs.telerik.com/kendo-ui/controls/scheduling/scheduler/how-to/scrolling/scroll-views-horizontally

 

If you do this, then enable selectable: true - it doesnt work correctly, essentially it only selects ever X group - hard to explain, please watch the video.

Is there a fix for this?

You can see the issue in the attached video (ZIPPED) and here is a modified dojo from yours with just selectable set.

https://dojo.telerik.com/@daniel_j/arUVUMAY

Thank You.

 

Aleksandar
Telerik team
 answered on 15 Jul 2020
1 answer
164 views

I'm having a similar issue as reported here: https://www.telerik.com/forums/drawdom-with-cloned-chart-fails#ko3KfThygUiX9Q22tdM4ZQ

I'm trying to export a chart to a pdf document that also includes some text and a grid. In my case the chart is a bubble chart. When I export I am only getting one bubble to display on the chart in the pdf even though the rest of the bubbles are displayed on the screen. If I add a setTimeout(function() {// code to finish exporting},5000); to my code I can get it to work but I don't like the idea of relying on setTimeout. I tried using the "render" event but that also only gave me one bubble in the final printout. When I tried the dataBound event it never fired. How do I fix this?

Aleksandar
Telerik team
 answered on 15 Jul 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
Drag and Drop
Application
Map
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
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?