Telerik Forums
Kendo UI for jQuery Forum
1 answer
134 views
Hi,

I want to build a MVC chart with three diffirent line series with their own color and dashtype.
The values of the x-axis are dates with the baseunit weeks and the y-axis consists of double values.

Is it possible to start a second line series at the date where the first serie ends and have a third line at the same time? See the attached chart image.

Should I group data? Should each line have the same amount of items? Is this possible?

Could you give me any leads on this problem?
Thanks in advance
Hristo Germanov
Telerik team
 answered on 06 May 2013
1 answer
269 views
Is there a way I can use the template configuration of chart elements like series, legend, etc, to add a custom class that I can style with my own css?

I can do regular css pathing , like

<style scoped>
div .chart svg g text:hover
{
cursor: pointer;
}
</style>

But I would love a simpler and more elegant solution of just adding and referencing my own specific classes.

Thanks
Hristo Germanov
Telerik team
 answered on 06 May 2013
6 answers
78 views

All... I have to change the Grid Layout on an user selection. So the grid will have different column layout and different datasource set for each User selection..
So I did the obvious chose of a Kendo Newbe ... I destroyed the previously created Kendo grid, cleared the grid inner html and recreated the kendo grid using the new column values
Everything works fine.. but after the second selection (first selection is when the kendogrid is first created) ... the grouping wont work ..

any lime light on this issue is appriciated...
Here is the code snippit..
 
<div id="grid" style="height: 380px"></div>

var ViewGridId = 'grid';
var ViewGrid = $("#" + ViewGridId).data("kendoGrid");          
if (ViewGrid) {
 ViewGrid.destroy();
 }
$("#" + ViewGridId).html('');
$("#" + ViewGridId).kendoGrid({
                    dataSource: {
                        data: DataSourceArray,
                        pageSize: 5
                    },
                    change: TryCrmView_FetchXmlMethod.ViewGrid_onChange,
                    selectable: "single",
                    groupable: true,
                    sortable: true,
                    pageable: {
                        refresh: true,
                        pageSizes: true
                    },
                    columns: ColumnsArray
                }); 

 

 

 

 

Atanas Korchev
Telerik team
 answered on 06 May 2013
1 answer
514 views
Hi,

How do you make the "open link in new window option" checked by default, or always checked?

This option is in the "insert hyperlink" dialog for the editor.

Thanks



Alex Gyoshev
Telerik team
 answered on 06 May 2013
1 answer
294 views
Is it possible to sum a column without including all rows in that column.

IE
a  2
b  3
c  2
d  8
sum = 12

but only sum up a+c+d
Nikolay Rusev
Telerik team
 answered on 06 May 2013
2 answers
110 views
I'm not sure what is the best way for my scenario, so I'll explain that first.

I have two datasources. Persons and Groups, each Person-Item has an indicator, to which group it belongs to. The persons are binded to a kendo-grid and the groups to a <ul>. My problem is, that I want to display a count-number besides the group, which indicates how many persons are in that group - this information is calculated from the persons-datasource and not part of the group itself.

Sorry for that generic question - but I'm really struggling with this...

01.var contactGroupsDataSource = new kendo.data.DataSource({
02.  transport: {
03.    read: {
04.      url: "api/contactgroups"
05.    }
06.  }
07.});
08. 
09.$('#contactGroupsList').kendoListView({
10.    dataSource: contactGroupsDataSource,
11.    template: "<li class='contactGroupListItem' data-number='${Number}'>${Number} ${Name} (<span data-bind="text: cgcount[1]"></span>) </li>"
12.});
13. 
14.viewModel = kendo.observable({
15.        contactsDataSource: new kendo.data.DataSource({
16.            transport: {
17.                read: {
18.                    url: "api/contacts"
19.                }
20.            },
21.            schema: {
22.                model: {
23.                    id: "Id",
24.                    fields: {
25.                        id: { type: "string" },
26.                        FirstName: { type: "string" },
27.                        LastName: { type: "string" },
28.                        ContactGroupNumber: { type: "integer" }
29.                    }
30.                }
31.            },
32.            change: function (e) {
33.                var data = this.data();
34. 
35.                for (var i = 0; i < data.length; i++) {
36.                    var cg = data[i]["ContactGroupNumber"];
37.                    viewModel.cgcount.splice([cg - 1], 1, viewModel.cgcount[cg - 1] + 1);
38.                }
39. 
40.                for (var i = 0; i < 7; i++) {
41.                    console.log(i + 1 + ': ' + viewModel.cgcount[i]);
42.                }
43.            }
44.        }),
45.        cgcount: new kendo.data.ObservableArray([0, 0, 0, 0, 0, 0, 0])
46.    });
47. 
48.    kendo.bind($("#contactsGroupContainer"), viewModel);
49. 
50.    contactsListView = $('#contactsList').kendoGrid({
51.        dataSource: viewModel.contactsDataSource,
52.        sortable: true,
53.        rowTemplate: kendo.template($("#rowTemplate").html())
54.    });
Daniel
Top achievements
Rank 1
 answered on 05 May 2013
1 answer
66 views
I have a kendoObservable (numeric value) that is bound both to a span (text: ) and a kendo slider (value:)

I have a button that increments the value. But only the text version is updating. What did I do wrong?

An example is worth a thousand words:

http://jsbin.com/afogaq/2/

One wrinkle here is that i need to dynamically add the slider. So there is a button at the top that you have to hit first, to add the slider to the DOM. Then just press the [increment] button to see what is going on.

(do I have to rebind the VM, after adding the slider?).
Holger
Top achievements
Rank 1
 answered on 05 May 2013
1 answer
442 views
I have an object:
public class User
{
    public int Id { get; set; }
    public string Name { get; set; }
}
And in the editor template, where model.Members are a collection of Users
@(Html.Kendo().MultiSelectFor(model => model.Members)
    .DataValueField("Id")
    .DataTextField("Name")
    .Placeholder("Type user's name...")
    .DataSource(source =>
    {
        source.Read(read =>
        {
            read.Action("MemberRead", "Group");
        });
    }))
When posting the form containing this multiselect I get the following post data
Id:0
Name:Test
Description:Test
Members.Id:1
Members.Name:Jan
Members:[object Object]
Now as far as I can tell the post data is correct, except for"Members:[object Object]" which Kendo throws an error for. When the model is received by the controller, the Members field is null.

What settings are incorrect?

(Note that MemberRead is populating the MultiSelect correctly)

(Also note that this form is part of a popup editor of a grid, in which everything else is working correctly)
Georgi Krustev
Telerik team
 answered on 05 May 2013
4 answers
83 views
Hello,

I could use a bit of advice.

I am working with a listview that has tiered sections. I can click on each branch in the tree to drill down to the next level. It looks like this: 
$("#listview").kendoMobileListView({
    dataSource: data,
    template: kendo.template($("#exampleTemplate").html()),
    click: function (e) {
         // event to handle change in dataSource
         $("#listivew").data("kendoMobileListView").setDataSource(dataSource);
    }
});
This is working - the problem occurs if I revisit a view. If I click through the list, updating the dataSource and showing the new options, I can't go back and choose a different option. If I try, I am met with an "Uncaught TypeError: Cannot read property 'sectionId' of undefined". 

It's a category list with sub-categories underneath. If I click Shoes > Sandals > Flip-Flops everything works, but if I try to go back and change from Flip-Flops to something else, I'm met with the TypeError.

This tells me that the data isn't getting bound to the view when I go back (right?). I currently use onShow() to set up the dataSource. When using onBeforeShow() the list won't update with new data after the first time through, so going back and selecting Hiking Boots instead of Sandals will still show me the results for Sandals.

Is there another method I could use to get this data to show up correctly on subsequent passes through the list?

Thanks!
Petyo
Telerik team
 answered on 04 May 2013
5 answers
161 views
Currently I am receiving an error when accessing a Kendo Window of a partial page with a Grid inside:

SCRIPT5022: DOM Exception: NOT_FOUND_ERR (8) 
kendo.web.min.js, line 16 character 31193

l.table[0].replaceChild(r,l.tbody[0])

My window Kendo window code is as follows:

@(Html.Kendo().Window()
                    .Name("mbWindow")
                    .Width(630)
                    .Height(530)
                    .Title("Add Element")
                    .Content(
                    @<text>
                    @Html.Partial("../Controller/PartialPage")
                    </text>)
                    .Draggable()
                    .Visible(false))

My partial page is as follows:

@{
    ViewBag.Title = "Elements";
}
<h2>
    Elements</h2>
<div id="mxBWindow">
    @(Html.Kendo().Grid<Model.MB>()
            .Name("MBGrid")
                .HtmlAttributes(new { style = "height:460px;" })
            .Columns(columns =>
            {
                columns.Bound(p => p.ID);
                columns.Bound(p => p.Amount);
                columns.Bound(p => p.ParentID);
                columns.Command(command => command.Destroy()).Width(110);
            })
            .ToolBar(toolbar =>
            {
                toolbar.Create();
                toolbar.Save();
            })
            .Editable(editable => editable.Mode(GridEditMode.InCell))
            //.Pageable()
            //.Sortable()
            //.Selectable(s => s.Enabled(true))
            //.Navigatable(n => n.Enabled(true))
            .DataSource(dataSource => dataSource
                .Ajax()
                .Batch(true)
                .ServerOperation(false)
                .Events(events => events.Error("error_handler"))
                .Model(model => model.Id(p => p.ID))
                        .Create("Editing_Create", "Grid")
                        .Read("Editing_Read", "Grid")
                        .Update("Editing_Update", "Grid")
                        .Destroy("Editing_Destroy", "Grid")
            )
                .Events(ev => ev.SaveChanges("submitElements"))
    )
</div>

I have noticed that when I remove this Grid from the partial page, the window gives me no errors. Both pages, however, when accessed individually give me no errors. Yet when I add the Grid back in with the Kendo Window, I get the DOM Exception.

Page w/Grid - No Errors
Page w/Window - No Errors
Page w/Window(w/Grid Inside) - Error/DOM Exception

Could someone please point me out what might be causing this error?
Louis
Top achievements
Rank 1
 answered on 03 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?