Telerik Forums
Kendo UI for jQuery Forum
3 answers
368 views

Hi,

I am using KendoUI for javascript angular directive. I have a list of tree object like:

dc.DataSource=[{Name:"Item1",Children:[{Name:"Item1.1"},{Name:"Item1.2"}]},

 {Name:"Item2",Children:[{Name:"Item2.1"},{Name:"Item2.2"}]}

];

What I want to achieve is show each object in datasource in a listview template, and inside the template, I want to use tree view to display the hierarchical data(and a checkbox for each item data). In below code, I just want to know how to set the datasource of the treeview since it is different for each item

<div kendo-list-view k-data-source="dc.DataSource">
        <div k-template>
            <div class="col-md-3">
                <div kendo-tree-view="tree"  k-data-source="{{dataItem}}">
                    <span k-template>
                        {{dataItem.Name}}
                    </span>
                </div>
            </div>
        </div>
    </div>

Thanks,

Ziff

Viktor Tachev
Telerik team
 answered on 28 Nov 2018
3 answers
1.5K+ views
Hi Guys,
I have a Grid bound to a remote datasource like this

$("#rolesGrid").data("kendoGrid").setDataSource(new kendo.data.DataSource({
            transport: {
                read: {
                    url: "Url1",
                    type: "POST"
                },
                update: {
                    url: "Url2",
                    dataType: "json",
                    type: "POST"
                }
            },
            schema: {
                model: {
                    id: "Id",
                    fields: {
                        Id: { type: "int", editable: false },
                        Name: { type: "string", editable: true },
                        Description: { type: "string", editable: true },
                        Roles: { type: "odata", editable: true }
                    }
                }
            },
            pageSize: 10,
            sort: { field: "Nome", dir: "asc" }
        }));
The Roles field contains a list of custom object; each of this object has some simple properties (int and string).
When the grid is loaded I show a simple count of Roles list for each record.
es
{
     field: "Roles",
     title: "roles",
    template: "<div>#= Roles.length#</div>"
}
I set the edit mode as INLINE.
Is it possible to use a custom template so that text properties are edited with textboxes as usual and  "Roles" property is rendered as, for example, a dropDownList ???

I tried with a template as I'd like to do with popup edit mode but it seems to be useless.

Thanks
Fabio
Viktor Tachev
Telerik team
 answered on 27 Nov 2018
3 answers
463 views
Hi,

I'm trying to use localized strings from kendo.messages.pl-PL.min.js in my kendo grid, but attaching that JS file to my view and executing kendo.culture("pl-PL") doesn't make any changes in grid pager - "No items to display" remains English, not Polish.
How can I use localizations from kendo.messages.pl-PL.min.js? Is there any special way to make it work? Unfortunately, all tutorials mention cultures file only.

Thanks in advance,
GJ
Viktor Tachev
Telerik team
 answered on 27 Nov 2018
1 answer
84 views
Hello, please find the attached file and let me know if we can use mvvm model in this scenario or not. I have 2 ViewModels . I want to have 3 ViewModels in this attached View. Is it possible? 
Dimitar
Telerik team
 answered on 27 Nov 2018
4 answers
138 views
Hello,
          Can we bind 3 observable to different parts of template? The reason to have 3 observable is to have modularity and performance improvement. Earlier we had 2 observable and our object are pretty big. We dont want to have more processing and UI rendering delays so we have thought to have 3 observable .
         Now the thing is we have a window all coded mvvm way. This window needs object to be binded to open , if i bind empty object later , i cannot bind any div with observable object . kendo.bind() doesnt have any output then.
         What would be solution for this?
Neeraj
Top achievements
Rank 1
Veteran
 answered on 27 Nov 2018
2 answers
418 views

Hi,

i have created scheduler using kendo UI, where start time if 12 Mid night so that i can see 24 hours for that day

there is horizontal scroll bar coming which i dont want.

i would like to have default single page view for 24 hours and if i need i can zoom in to view the detail task

how we can do that

Thanks

Siddhartha

Dorian
Top achievements
Rank 1
 answered on 26 Nov 2018
1 answer
227 views

Hi, I think that I found a bug.

I can reproduce it there: 

https://dojo.telerik.com/@foxontherock/EvuWidey

In my app, I need to use "setOptions" sometimes, because I need to change my "columns" collection depending on the data I display.

If I send non-empty data in my setOptions parameter, it looks like they are kept somewhere, they're back later when I try to sort an empty grid.

Steps to reproduct:

1. Initialise with empty data + columns, sortable.
2. Change the dataset, using the kgrid.setOptions(dataSource: {data: [non empty array]})
3. Now, empty the grid with kgrid.dataSource.data([])
4.Click any header to sort the grid.
Surprise!  the original data from step 2 is back!

You can try it easily in my "dojo" sample.

https://dojo.telerik.com/@foxontherock/EvuWidey

For now, what I did is to always use setOptions with empty data, then applying my data after, and it solve my problem. 

But, I take time to mention it to you because I think it's a bug that can happen to someone else.

Thank you

Georgi
Telerik team
 answered on 26 Nov 2018
3 answers
124 views

How can I use the tree view with MVVM while at the same time only fetching the nodes that I need.  The sample shows setting up the observableHierarchy and that is it.  Is it even possible?

 

I know i can set hasChildren to be true on the parent, but how do i then grab the children?

Veselin Tsvetanov
Telerik team
 answered on 26 Nov 2018
2 answers
88 views

Hello can anyone point me to a Visual Studio example of the following Kendo MVVM example code?

https://demos.telerik.com/kendo-ui/mvvm/source

In other words, i would like to seperate this code into "....htm", "....js" modules and put them into the typcial Visual Studio code diretories like /script and ect.

thanks for any pointers

robert
Top achievements
Rank 1
 answered on 23 Nov 2018
1 answer
712 views

I'm getting a "too much recursion" error when using a kendo.observable with nested dependent method. I have a nested observable object that needs to get and set values for a field depending on another field's value, so I used the example from the ObservableObject docs, where you have a field bound to a function that gets or sets a value based on whether a parameter is passed in.  This works great when the function is on the top level of the kendo.observable, but when it's nested several levels deep, there's some odd behavior...  Here's a Dojo example:

https://dojo.telerik.com/UpUcaxaP/2

It seems to work when you call the nested dependent function directly in JS or from the console, but as soon as it's bound to the HTML input field with data-bind, it gives the "too much recursion" error.  If you comment out the "this.set('nestedValue', param);" line, then you don't get the recursion error on binding, but when you change the value in the input box you get "TypeError: d.fields is undefined".  I've tried with both the straight use of "this" and also with the "self" one-liner referenced in my other post, and haven't been able to get it to work correctly.  Any ideas on what I'm doing wrong?

Thanks!

Ivan Danchev
Telerik team
 answered on 23 Nov 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?