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
$(
"#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"
}
}));
{
field:
"Roles"
,
title:
"roles"
,
template:
"<div>#= Roles.length#</div>"
}
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
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
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?
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
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!