Hi,
In your demo http://demos.telerik.com/aspnet-mvc/treelist/editing i can add new item.
1. But how can i add sub item on selected item?
2. How move item to another level?
Thanks.
In your demo http://demos.telerik.com/aspnet-mvc/treelist/editing i can add new item.
1. But how can i add sub item on selected item?
2. How move item to another level?
Thanks.
4 Answers, 1 is accepted
0

Sergi0
Top achievements
Rank 1
answered on 04 Feb 2015, 09:05 PM
I finded example in http://docs.telerik.com/kendo-ui/api/javascript/ui/treelist . createChild column command added new sub item in current item. It's work in sandbox http://dojo.telerik.com/ogihe.
But in MVC demo that i use from ASP.NET MVC Q3 2014 SP1 it's not work. Demo is freezes when i added new child item.
But in MVC demo that i use from ASP.NET MVC Q3 2014 SP1 it's not work. Demo is freezes when i added new child item.
<div
class
=
"demo-section k-header"
>
@(Html.Kendo().TreeList<Kendo.Mvc.Examples.Models.TreeList.EmployeeDirectoryModel>()
.Name(
"treelist"
)
.Toolbar(toolbar => toolbar.Create())
.Columns(columns =>
{
columns.Add().Field(e => e.FirstName).Width(220);
columns.Add().Field(e => e.LastName).Width(160);
columns.Add().Field(e => e.Position);
columns.Add().Field(e => e.HireDate).Format(
"{0:MMMM d, yyyy}"
);
columns.Add().Field(e => e.Phone);
columns.Add().Field(e => e.Extension).Title(
"Ext"
).Format(
"{0:#}"
);
columns.Add().Width(200).Command(c =>
{
c.Edit();
c.Destroy();
c.CreateChild();
})
.HtmlAttributes(
new
{
style =
"text-align: center;"
});
})
.Editable()
.DataSource(dataSource => dataSource
.Create(create => create.Action(
"Create"
,
"EmployeeDirectory"
))
.Read(read => read.Action(
"All"
,
"EmployeeDirectory"
))
.Update(update => update.Action(
"Update"
,
"EmployeeDirectory"
))
.Destroy(delete => delete.Action(
"Destroy"
,
"EmployeeDirectory"
))
.Model(m => {
m.Id(f => f.EmployeeId);
m.ParentId(f => f.ReportsTo);
m.Field(f => f.FirstName);
m.Field(f => f.LastName);
m.Field(f => f.ReportsTo);
m.Field(f => f.HireDate);
m.Field(f => f.BirthDate);
m.Field(f => f.Extension);
m.Field(f => f.Position);
})
)
.Height(540)
)
</div>
0
Hello Sergi,
Unfortunately there is a bug in our implementation. We will do our best to address it as soon as possible. As a workaround you can disable server operations, i.e:
.DataSource(dataSource => dataSource.ServerOperation(false)
Regards,
Nikolay Rusev
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0

Sergi0
Top achievements
Rank 1
answered on 17 Feb 2015, 03:16 PM
Hello Nikolay,
I updated telerik mvc to sp2 and i used same example.
When i created a child item for first level all is OK.
But when i add child item for before added item i'm still got freezed browser window.
chrome developer network tab showed me request:
If i use .ServerOperation(false) all is OK tree item added well.
Is it normally?
I updated telerik mvc to sp2 and i used same example.
When i created a child item for first level all is OK.
But when i add child item for before added item i'm still got freezed browser window.
chrome developer network tab showed me request:
Remote Address:[::1]:56541
Request URL:http://localhost:56541/razor/EmployeeDirectory/All
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Encoding:gzip, deflate
Accept-Language:ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
Content-Length:27
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Host:localhost:56541
Origin:http://localhost:56541
Referer:http://localhost:56541/razor/treelist/editing
User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36
X-Requested-With:XMLHttpRequest
Form Dataview sourceview URL encoded
sort:
group:
filter:
id:104
Response Headersview source
Cache-Control:private
Content-Length:33560
Content-Type:application/json; charset=utf-8
Date:Tue, 17 Feb 2015 15:05:59 GMT
Server:Microsoft-IIS/8.0
X-AspNet-Version:4.0.30319
X-AspNetMvc-Version:5.0
X-Powered-By:ASP.NET
X-SourceFiles:=?UTF-8?B?QzpcUHJvZ3JhbSBGaWxlcyAoeDg2KVxUZWxlcmlrXFVJIGZvciBBU1AuTkVUIE1WQyBRMyAyMDE0XHdyYXBwZXJzXGFzcG5ldG12Y1xFeGFtcGxlc1xWUzIwMTNcS2VuZG8uTXZjLkV4YW1wbGVzXHJhem9yXEVtcGxveWVlRGlyZWN0b3J5XEFsbA==?=
If i use .ServerOperation(false) all is OK tree item added well.
Is it normally?
0
Hello Sergi,
Indeed you are correct. We will investigate this issue further.
Regards,Nikolay Rusev
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.