Dear All,
I have a treeview & listview in different spliter panes.
I successfully retrieved the tree-view data, what I want now is to display the related items of the selected tree-view node.
here is what I have so far:
@(Html.Kendo().Splitter()
.Name(
"RefFilesSplitter"
)
.HtmlAttributes(
new
{ @style =
"height:100%;"
})
.Panes(panes =>
{
panes.Add()
.Size(
"310px"
)
.Collapsible(
true
)
.Content(
@<div id=
"RefFiles"
>
@(Html.Kendo().TreeView()
.Name(
"TVtoc"
)
.HtmlAttributes(
new
{ @style =
"height:100%;width:100%"
})
.DragAndDrop(
true
)
.DataTextField(
"Name"
)
.DataSource
(dataSource => dataSource
.Read(read => read.Action(
"GetGroups"
,
"TreeOfAccounts"
))
.Model(m => m.Id(
"GroupId"
))
.Events(e => { e.RequestEnd(
"requestEndHandler"
); })
)
.Events(e => e.Select(
"onSelect"
))
)
</div>);
panes.Add()
.Content(
@<div id=
"RefFilesContent"
>
@(Html.Kendo().ListView<IdeaGL.Models.IGL_account>()
.Name(
"LVAccounts"
)
.HtmlAttributes(
new
{ @style =
"height:100%;width:100%"
})
.ClientTemplateId(
"template"
)
.TagName(
"div"
)
.DataSource
(dataSource => dataSource
.Read(read => read.Action(
"GetAccounts"
,
"TreeOfAccounts"
,
new
{groupid=Model.GroupId}))
.Model(m => m.Id(
"account_id"
))
)
.Pageable()
)
</div>);
})
)
and here is the JavaScript OnSelect:
function
onSelect(e)
{
// this doesn''t work ...
$(
"#LVAccounts"
).data(
"kendoListView"
).dataSource.read();
$(
"#LVAccounts"
).data(
"kendoListView"
).refresh();
var
data = $(
'#TVtoc'
).data(
'kendoTreeView'
).dataItem(e.node);
$.ajax({
url:
"/TreeOfAccounts/GetAccounts?groupid="
+ data.id
}).success(
function
()
{
// what should i do here !!
})
}
I can see how to make the listview refresh the data for the selected treeview node.
any help ?