or
Hi,
Is it possible to find a node by id (clientside)?
Here is how we populate the treeview.
public
JsonResult _AjaxLoading(
string
id)
{
IEnumerable nodes = from item
in
GetDirectorys()
where (id ==
null
? item.parent ==
""
: item.parent == id)
select
new
{
id = item.directory,
Name = item.name,
hasChildren = item.aantal > 0,
};
return
Json(nodes, JsonRequestBehavior.AllowGet);
}
<
script
id
=
"gridEditTemplate"
type
=
"text/x-kendo-template"
>
Content here
</
script
>
@(Html.Kendo().Grid(Model.Amounts)
.Name("MyGrid")
.BindTo(Model.Amounts)
.ToolBar(commands => commands.Create().Text("add"))
.DataSource(dataSource => dataSource
.Ajax()
.Events(ev => ev.Change("onChange"))
.Update("Update", "Special")
.Destroy("Delete", "Special")
.Create("Insert", "Special")
.Model(model =>
{
model.Id(p => p.ID);
model.Field(p => p.Amount);
model.Field(p => p.Type);
}).ServerOperation(false))
.Columns(columns =>
{
columns.Bound(p => p.Amount).Title("Amount");
columns.Bound(p => p.Type).Title("Type).Width(70);
columns.Command(command => { command.Edit(); command.Destroy(); }).Width(160);
})
.Editable(editable => editable.Mode(GridEditMode.PopUp).CreateAt(GridInsertRowPosition.Bottom).Window(w => w.Title("Amounts: ")))
)
grid.bind("edit", function (e) {
grid.cancelChanges();
window.location = '@Url.Action("AddEditCoalition","InputData",new{coalitionId=Model.CoalitionId})' + '&formId=' + e.model.Id;
}