Hello,
the following grid is working fine, and do the job h
01.
@(Html.Kendo().Grid<
QMatrix.Models.UserModel
>()
02.
.HtmlAttributes(new { style = " height: 750px" })
03.
.Name("gridUsers")
04.
.Pageable()
05.
.Scrollable()
06.
.Filterable(filter => filter.Mode(GridFilterMode.Menu))
07.
.Columns(col =>
08.
{
09.
col.Bound(m => m.Personalnummer).Title("Personalnummer");
10.
col.Bound(m => m.Name).Title("Name");
11.
col.Bound(m => m.Nachname).Title("Nachname");
12.
col.Bound(m => m.Planstelle).Title("Planstelle");
13.
})
14.
.DataSource(ds => ds
15.
.Ajax()
16.
.PageSize(30)
17.
.Model(model => model.Id(m => m.ID))
18.
.Read(read => read.Action("ReadAllUsers", "User")))
19.
)
Now i want to add a custom command button, which open a kendo window that loading an content specific by an ID from grid.
But when i add a the following Custom Command Button the grid stop working, datasource is no longer read ?
Grid displays no data available.......
1.
col.Command(command => { command.Custom("CustomCommand").Click("editUserPermission").Text("Bearbeiten"); });
Javascript:
01.
<script type=
"text/javascript"
>
02.
function
editUserPermission(e) {
03.
e.preventDefault();
04.
05.
var
dataItem =
this
.dataItem($(e.currentTarget).closest(
"tr"
));
06.
var
wnd = $(
"#AddPermission"
).data(
"kendoWindow"
);
07.
08.
wnd.LoadContentFrom(
"EditRights"
,
"User"
,
new
{ UserID = dataItem.ID });
09.
wnd.center().open();
10.
}
11.
</script>
Can anyone explain to me ? :/
thanks ..