Telerik Forums
Kendo UI for jQuery Forum
1 answer
154 views

Hello

I have a kendo grid bound to the following kendo template code in MVC.

<script type="text/kendo-tmpl" id="AgencyItemTemplate">
   @Html.Action("MyTemplate", "MyController", new {area = "MyArea"})

</script>

 This actions renders another kendo grid with the following code:

  @(Html.Kendo().Grid<SomeModel>()
        .Name("MyGrid_#=idFromTemplateCaller#")
        .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("Refresh", "MyController", new { area = "MyArea", idFromTemplateCaller= "#=idFromTemplateCaller#" }))
            .Sort(sort => sort.Add(c => c.CreatedDateTime).Descending())
        )

        .Columns(cols =>

        {
            cols.Bound(a => a.FirstProperty)
                .Width(80)
                .Format("{0:c}");
            cols.Bound(a => a.SecondProperty)
                .Width(80)
        })
        .ToClientTemplate()
    )

This works fine, the way it works is the following. There is a "master grid" which offers the user to see details of each of the records. These details are shown in the grid inside the template, passing the "idFromTemplateCaller" to retrieve the appropiate details for each record. What I want to do is the following: when there are no details, remove the grid and show the following custom element

 <div id="noDetailsFound" style="display: none;">

No details found
</div>

This I would normally achieve by binding a custom event  to the Databound of the grid by adding the following line of code

.Events(e => e.DataBound("myPageNS,myJSEvent"))

 And the event would be defined in the same details grid file as follows:

 <script type="text/javascript">

(function(){

     this.myPageNS = this.myPageNS || {};

    myPageNS.myJSEvent = function(){

        alert("fire databound event");

    }

}());

</script>

 

However, I am unable to write javascript code inside the template file. I guess this is because templates are in fact javascript code, so I cannot call the <script> tag. Can you please help? I need this code to be in the same file as the grid, I now that putting it outside the kendo template might work but I do not want to do it because it wouldnt follow my architecture principles.

 I investigated and saw that I am able to write JS code inside the hash symbol #. However, this doesn't work properly in the IIFE. It fails systematically

Greetings,

Luis.

Luis
Top achievements
Rank 1
 answered on 27 Apr 2015
1 answer
152 views

Hi there!

 I am using the Group Footer Template in the Kendo UI Grid using Angular JS:

groupFooterTemplate: "<input id='PlansTY_SubTotal' type='number' value='#=sum#' ng-model='planChange' ng-change='onPlanChange()'>"

 The onPlanChange() function is not getting fired.

 

Thanks!

Boyan Dimitrov
Telerik team
 answered on 27 Apr 2015
1 answer
1.6K+ views

Hi there,

I am seeking to achieve the same outcome as described in this forum post - changing the default behaviour of the numeric textbox when a min and max value has been supplied. The default behaviour is

  • For a numeric textbox with min =0, max = 100
  • User mistakenly types in 500 instead of 50
  • Control automagically "corrects" this to 100 (this just seems plainly wrong) without informing the user in any way.

I had already tried to implement something similar to the solution mentioned in that forum post - however, it doesn't work (presumably because the controls have been updated since). By the time the validation rule runs, the value has already been adjusted to the maximum value, so the rule always passes.

Can you advise how I can achieve this behaviour? I am using Q3 2014.

Thanks,

 

Paul.

 

Daniel
Telerik team
 answered on 27 Apr 2015
2 answers
238 views

I am trying to utilize a Kendo UI scheduler in an Angular app.  After much frustration and realizing that Kendo UI does not support angular templates properly for the scheduler editor, I'm trying to re-implement the "standard" editor as a Kendo UI template.  This is not my preferred method (I'd rather it work from an Angular template), but from what I've read, I don't have a choice at this time.

I'm using the latest Kendo UI Pro v. 2015.1.408

I need the full template layout and behavior including timezone (not needed right now, but useful), the full editor for repeating tasks, and the resource editor.  I will be adding custom fields to it in certain circumstances.

I found a template for version 2013.3.1119 but this is way out of date, I would think...

http://www.telerik.com/support/code-library/custom-editor

Thanks!

Phil
Top achievements
Rank 1
 answered on 27 Apr 2015
1 answer
179 views

Hi

I took your example of virtual scrolling and added a detail template:

http://dojo.telerik.com/oCiTO

When I scroll to the bottom and expand row 49'999 then the scroll area does not get adjusted - ie. the row 50'000​ is not visible or gets cut.

How can this be fixed? Rerender the grid somehow?

Many thanks

Dimo
Telerik team
 answered on 27 Apr 2015
6 answers
135 views
There appears to be a problem with the k-header class' gradients when used with the DropDownList and ComboBox. The problem appears in those widgets' demos and in a custom DropDownList that I built off the demo. The problem occurs in both Chrome and FireFox.
Sriraksha
Top achievements
Rank 1
 answered on 27 Apr 2015
1 answer
191 views

I'm wondering if it's possible to exclude parent nodes in the treelist when using a filter. For example, let's say we have the following data:

 

Animal: {
    id: 1
    parentId: null
    name: "Animal"
}
 
Dog: {
    id: 2
    parentId: 2
    name: "Dog"
}

 

When I populate a treelist with this data, I filter by the string "dog". What displays is the parent node "Animal" with the child node of "Dog". I'd like to only display the child node "Dog" since it matches my filter. Is this possible or does the parent node always have to be present?

Nikolay Rusev
Telerik team
 answered on 27 Apr 2015
1 answer
102 views
I can call the "select" method to select an event on scheduler, but how to scroll the scheduler to let the event show on screen?
Vladimir Iliev
Telerik team
 answered on 27 Apr 2015
3 answers
280 views
If I use '#' as a column header without specifying data-field it prevents the column contents from rendering.  Example: http://dojo.telerik.com/ikAbU
Vladimir Iliev
Telerik team
 answered on 27 Apr 2015
5 answers
729 views

Hi Telerik Team,

I have defined custom event template for my scheduler. When I move event in the scheduler I am getting errror as "Uncaught TypeError: Cannot read property 'occurrenceByUid' of undefined".

When I debugged the Javascript and found that the error is coming in the below code

(function(data
/**/) {
var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;with(data){$kendoOutput='\n    ';var uid = target.attr("data-uid");;$kendoOutput+='\n    ';var scheduler = target.closest("[data-role=scheduler]").data("kendoScheduler");;$kendoOutput+='\n    ';var model = scheduler.occurrenceByUid(uid);;$kendoOutput+='\n   \n    ';if(model) {;$kendoOutput+='\n        <strong>Job Start:</strong> '+(kendo.format('{0:ddd M/dd, hh:mm tt}',model.start))+'<br />\n        <strong>Job End:</strong> '+(kendo.format('{0:ddd M/dd, hh:mm tt}',model.end))+'<br />\n        <strong>Job Details:</strong> '+(model.title)+'<br />\n    <strong>Job Address:</strong> '+(model.Address)+'\n    ';} else {;$kendoOutput+='\n        <strong>No event data is available</strong>\n    ';};$kendoOutput+='\n';}return $kendoOutput;
})

 

where the "var scheduler = target.closest("[data-role=scheduler]").data("kendoScheduler")" is undefined and the error is coming. Please help how to fix it.

Vladimir Iliev
Telerik team
 answered on 27 Apr 2015
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?