Telerik Forums
Kendo UI for jQuery Forum
3 answers
223 views
Hi Kendo team

A tiny issue. I have enabled row-selection in my treelist. Unfortunately If I expand a row, it gets selected. You can try it yourself on the ‘Basic usage’ example of TREELIST. Add this in the code: selectable: "row".

Perhaps its intended, but when I try the same with the ‘Hierarchy’ demo of GRID, the rows are not automatically selected when they are expanded. I think that’s the best design.

And one last wish – I almost promise: a Select event :o)

Thank you so much for this UI!
Nikolay Rusev
Telerik team
 answered on 04 Dec 2014
2 answers
91 views
when kendo window iframe option set to true controls inside window get focus only after second click

http://jsfiddle.net/b64g1kjv

I want to interact with window controls (click buttons, open selects) immediatly (after first click).

How can I do this?
Kiril Nikolov
Telerik team
 answered on 04 Dec 2014
2 answers
269 views
Please guide me to use the option of kendo UI GRID in getting the "+" icon in the last row last column.
When I click on that, I should get a new row and the "+" should move to the current last row last column respectively.

karthik
Top achievements
Rank 1
 answered on 04 Dec 2014
3 answers
101 views
Recently upgraded to kendo v2014.3.1119  from Kendo UI 2014.2.716 and are also using angular AngularJS v1.3.0-beta.6. Upon upgrade we saw few issues and upon reading some Angular release notes we found out that they have a new version AngularJS v1.3.2 which we upgraded and found out certain UI not functioning correctly.  This functionality worked correctly when used with Kendo UI 2014.2.716 & AngularJS v1.3.0-beta.6.

Is there any know incompatibility issues for the latest Kendo UI to work with latest angular (AngularJS v1.3.2)?

One of a prominent issue is with the
grid filter (filterable:
{mode:"row"}) and the filter text is template: statusDropDownFilter. The filter dropdown
does not get rendered with the data. The code below was written to do this. It worked
fine before the upgrade.

function statusDropDownFilter(container) {
                var statuses = [];
                var deferred = $q.defer();
                var promise = deferred.promise;

                clientLookupsSvc.getStatus().
                        then(function (data) {
                            statuses = data;
                            deferred.resolve(statuses);
                        }, function (error) {
                            // vm.gridErrors.push(error);
                        });

                $q.all(promise).then(function () {
                    deferred.resolve(statuses);
                    container.element.kendoDropDownList({
                        type: 'aspnetmvc-ajax',
                        valuePrimitive: true,
                        dataTextField: "DisplayName",
                        dataValueField: "Id",
                        dataSource: statuses,
                        autoBind: false
                    });
                });
            }

Petur Subev
Telerik team
 answered on 04 Dec 2014
2 answers
100 views
KendoUI version v2014.2.926 

I am trying to modify an html element after a view is shown.

So, I do this:

var view = new kendo.View(
    templateId, {
        model: viewModel,
        show: function() {
            handleRenderDone();
         }
     }
 );



In my handleRenderDone function, I can tell that the html has not been rendered yet. Do I misunderstand what the show event is for as described in the doc here: http://docs.telerik.com/kendo-ui/api/javascript/view#events-show

Thanks


Ryan
Top achievements
Rank 1
 answered on 03 Dec 2014
2 answers
773 views
Hello all.
I currently have a kendo chart configured with two different series as can be seen in the following code:

@(Html.Kendo().Chart(Model)
            .Name("financialChart")            
            .DataSource(dataSource => dataSource                
                .Sort(s => s.Add(fc => fc.Date))
            )
            .Legend(legend => legend
                .Position(ChartLegendPosition.Bottom)
                .Labels(labels => labels
                    .Template("#= series.name #"))
            )
            .ChartArea(chartArea => chartArea
                .Background("transparent")
            )
            .SeriesDefaults(seriesDefaults =>
                seriesDefaults.Line().Style(ChartLineStyle.Smooth)
            )
            .Series(series =>
            {
                series.Line(value => value.MyValue, category => category.Date)                  
                  .DashType(ChartDashType.Dash)
                  .Name("Series1")
                  .Color("red")                                    
                  .Aggregate("selectLastPoint1");
                
             series.Line(value => value.MyValue, category => category.Date)
                 .Name("Series2")
                 .Color("blue")                 
                 .Aggregate("selectLastPoint2");
            })
            .CategoryAxis(axis => axis                        
                        .Labels(labels => labels.Rotation(0).Format("MMM 'yy"))
                        .Date()                        .
                        .BaseUnit(ChartAxisBaseUnit.Months)                                        
            )
            .ValueAxis(axis => axis.Numeric()                
                )
            .Tooltip(t => t
                .Visible(true)
                .Format("{0:c}")
                .Template("#= kendo.format('{0:C}', dataItem.MyValue) #")                               
            )            
            .HtmlAttributes(new { style = "margin: 0 15px 0 15px" })            
)

As you can see, Series1 is red and Series 2 is blue. However, Series1 and Series 2 have both a common point that is:

Series 1:
Jan 2014 - $50 - Point A
Feb 2014 - $100 - Point B

Series 2
Feb 2014 - $100 - Point C
Mar 2014 - $150 - Point D

When I hover over the points A and B the point fills in red and the tooltip has a red background. When I hover over points C and D the point fills in blue and the tooltip appears blue also.What I want is that point C has a RED fill and a RED tooltip as if it belonged to Series 1 and not Series 2.
The question is: Is there anyway that I can dinamycally set the tooltip color on the hover of the point?










Daniel
Telerik team
 answered on 03 Dec 2014
2 answers
276 views
Hi,

i am using the upload control with angularjs and asp.net mvc. i have this below html

k-async="{ saveUrl: 'upload', removeUrl: 'remove', autoUpload: true }"

my upload MVC action returns some data after file upload , how do i get hold of the return value from here?
Dimiter Madjarov
Telerik team
 answered on 03 Dec 2014
2 answers
333 views
I am trying to integrate the kendo ContextMenu with the Scheduler.  I found an example, but would rather use your context menu instead (http://jsbin.com/uNuQIPI/1/edit?html,js,output).  According to your docs, if I use a filter, then e.target should be the element found via the filter: "The current target of the ContextMenu - either the init target or the current element chosen through filter, if specified."  For some reason though, e.target is always the body element.  I don't know if that's because of the way I am appending the context menu to the body, or if it's something else.  Below is the Typescript method I have that creates and sets up the context menu for my scheduler.  It DOES show the context menu when I right-click a scheduler event, but the alert I threw in there always shows undefined, since e.target is not the actual element with the "k-event" css class (the block with an event in the scheduler).  Any ideas?

private setupContextMenu() {
            this._$contextMenu = $("<ul id='" + this._$scheduler.attr("id") + "-context-menu'></ul>").appendTo($("body"));
            this._contextMenu = new kendo.ui.ContextMenu(this._$contextMenu[0], {
                filter: '.k-event',
                dataSource: [{text: "Edit", spriteCssClass: "fa fa-edit" }, { text: "Delete", spriteCssClass: "fa fa-trash" }]
            });
            this._contextMenu.bind("select", (e) => {
                var dataSource = this._scheduler.dataSource;
                var uid = $(e.target).attr("data-uid");

                alert(uid);
                if (e.item.textContent === "Edit") {
                    var dataItem = <kendo.data.SchedulerEvent>dataSource.getByUid(uid);
                    this._scheduler.editEvent(dataItem);
                } else if (e.item.textContent === "Delete") {
                    var dataItem = <kendo.data.SchedulerEvent>dataSource.getByUid(uid);
                    this._scheduler.removeEvent(dataItem);
                }
            });
        }
Michael
Top achievements
Rank 1
 answered on 03 Dec 2014
6 answers
1.0K+ views
Hi guys,

I've been trying to write a generic templating framework that wraps up kendo to deliver a standardised view of a component.
So the idea is that in MVC I would just ask for a url like "~/{type}/Grid" or "~/{type}/View" or "~/{type}/Edit". 
For this to be viable I have to be able to prove that this is both maintainable but also "tweakable" in those situations where a type isn't quite the norm for some reason in its rendering requirements.

I get the feeling Kendo is well suited to this but it does require some magic tricks since MVC does not support generic views.
MVC supports generics of course but no way to say something like this in a view to have a multi type view ...

1.@model ComponentViewModel<T>
2.@Html.Kendo().Grid<T>() ...

... So i started looking at ways to effectively "work around that MVC limit".

I came to the conclusion that If I defined a generic controller and did url binding by convention I could get the type of the controller so I would know what that T actually was and create a ComponentViewModel<T>.
Then if ComponentViewModel<T> had a base class that was the non generic version where T was a type property I could then do something like this to generate an editor for an object of type T ...

01.@using System.Text.RegularExpressions
02.@using App.Models
03.@model ComponentViewModel
04.@{
05.    var rootId = Model.TypeName + Model.ObjectId + "_Editor";
06.    var modelName = Model.TypeName + Model.ObjectId + "_EditorModel";
07.    var m = Activator.CreateInstance(Model.Type);
08.    var dependency = "emedia.dependency.get('" + Model.TypeName + "');";
09.}
10. 
11.<div id="@(rootId)" class="component k-content" data-type="@Model.TypeName" data-item-id="@Model.ObjectId">
12.    <h2><span class="k-sprite edit"></span> @Regex.Replace(Model.Type.Name, @"(?<!_)([A-Z])", " $1"): @Model.ObjectId <img src="@Url.Content("~/Content/close.png")" /></h2>
13.    <script>
14.        $(function () {
15.            @if(Model.CustomDependencyExists)
16.            {
17.                @Html.Raw(dependency)
18.            }
19. 
20.            var @modelName = emedia.createModel('@Model.TypeName', '@Model.ObjectId');
21.            var component = $("#@(rootId)");
22. 
23.            kendo.bind(component, @modelName);
24.            $(".details", component).validate();
25.        });
26.    </script>
27.    <form class="details">
28.        <div data-description="non dynamic templated stuff">
29.            <input type="hidden" name="ID" data-rule-required="true" data-bind="value: ID" />
30.        </div>
31.        <ul class="fieldList">
32.            @{ Html.RenderPartial("EditorTemplates/Object", m); }
33.        </ul>
34.        <hr />
35.        <button class="k-button" data-bind="events: { click: save }">Save</button>
36.    </form>
37.</div>

... Notice the call to Html.RenderPartial where an instance of a T is then MVC templated, pretty neat huh, that works a treat!
All good so far.

So then I thought, ok lets take this a step a further and see if we can template grids, taking things slow I figured it best to start with non editable grids.
Following the same convention I did this ...

01.@using System.Text.RegularExpressions
02.@using App.Models
03.@model GridComponentViewModel
04.@{
05.    var gridName = Model.TypeName + "Grid";
06.    var modelName = Model.TypeName + "Model";
07.    var dependency = "emedia.dependency.get('" + Model.TypeName + "');";
08.    var m = Activator.CreateInstance(Model.Type);
09.}
10. 
11.<div class="component k-content" data-type="@Model.TypeName">
12.    <h2><span class="k-sprite folder"></span> @Regex.Replace(Model.TypeName, @"(?<!_)([A-Z])", " $1")s <img src="@Url.Content("~/Content/close.png")" /></h2>
13.    <script>
14.        $(function () {
15.            //TODO: add signalR behaviour to allow grid update notifications from the server
16.            @if(Model.CustomDependencyExists)
17.            {
18.            @Html.Raw(dependency)
19.            }
20. 
21.            @(gridName)Change = function (arg) {
22.                if(typeof emedia.@(Model.TypeName).gridItemClick != 'undefined') {
23.                    var grid = $("#@(gridName)").data("kendoGrid");
24.                    var item = grid.dataItem(grid.select());
25.                    emedia.@(Model.TypeName).gridItemClick(item);
26.                }
27.            };
28. 
29.            var @modelName = emedia.createModel('@Model.TypeName');
30. 
31.            $("#@(gridName)").kendoGrid({
32.                dataSource: @modelName,
33.                rowTemplate: kendo.Template.compile($("#@(Model.TypeName)Row").html()),
34.                selectable: "row",
35.                columns: emedia.type.columnsFor("@Model.TypeName"),
36.                change: @(gridName)Change,
37.                error: page.error
38.            });
39.        });
40.    </script>
41.    <script id="@(Model.TypeName)Row" type="text/x-kendo-template">
42.        @{ Html.RenderPartial("DisplayTemplates/Row", m); }
43.    </script>
44.    <div id="@(gridName)" class="details"></div>
45.</div>

The row template in this case does the same as the object MVC template (iterates over each property and calls html.displayFor(property)) with the key difference being that the output is wrapped in a td tag to fit in a table row.
Here's where my problems begin.
In the editor template above the MVC view emits a kendo template that looks something like this ...

01.<script id="BusinessTaskRow" type="text/x-kendo-template">
02.    <tr>
03.        <td><span data-bind="text: ID"></span></td>
04.        <td><a href="" data-ref-type="Workflow" data-bind="attr: { data-ref: WorkflowID }, events: { click: refClick }">View Workflow</a></td>
05.        <td><span data-bind="text: Title"></span></td>
06.        <td><pre data-bind="text: Description"></pre></td>
07.        <td><span data-format="dd MMM yyyy" data-bind="text: Created"></span></td>
08.        <td><span data-format="dd MMM yyyy" data-bind="text: Due"></span></td>
09.        <td><span data-bind="text: BusinessTaskStatusID"></span></td></td>
10.    </tr>
11.</script>

.. when the call to kendoGrid is run I get a row for each item in my datasource but I get the template and no bound values in it.
As in, the template is literally the output for each item in the datasource.

So my question ...
Why does initialising a kendo grid only template and not bind (do I have to template something specific) as opposed to the editor scenario which is just binding and not templating?
The editor is working as I would expect, I call bind and it binds, and the markup that is emitted is the expected output on the server.
With the grid implementation however the markup that is emitted is a row definition and to each row I need to bind an item in the datasource.

The demos / documentation aren't clear about how the javascript kendo functions work internally but I would expect for consistency a templating operation to also perform a bind. 
This appears however to not be the case ... or did I miss something?

In other words ...
In an element I want to bind to I might write:
<td><span data-format="dd MMM yyyy" data-bind="text: Created"></span></td>

... but in an element template I would have to write ...
<td><span>#= kendo.toString(Created, 'dd MM yyyy') #</span></td>

My biggest issue is the inconsistency here.
On the server I have an MVC view for outputting an editable version and another for a non editable version, by this convention I now need 2 more versions of each view to account for when the field is being templated vs when it's being bound.

This also raises another interesting question, if a templates data source is updated is this reflected in the templated output since there is no "binding syntax" to inform kendo that the field is bound or do all templated updates trigger a fresh render of the template?

so if I do this ...
<td><span data-format="dd MMM yyyy" data-bind="text: Created, events: { click: myClick }">#= kendo.toString(Created, 'dd MM yyyy') #</span></td>

I can't seem to hook up the click handler.

T. Tsonev
Telerik team
 answered on 03 Dec 2014
2 answers
121 views
Hello,

Have problems with end date of last task. Dates are (end: "2014-11-24T18:00:00", start: "2014-10-13T07:00:00").
Gantt char suppose to hilight my task up to and including 24 day. But chart hilight only till 23 day. It doesnt display one hole work day.

Thank you.
Bozhidar
Telerik team
 answered on 03 Dec 2014
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?