This is a migrated thread and some comments may be shown as answers.

Grid not working on Custom Command

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Wenzl
Top achievements
Rank 1
Wenzl asked on 24 Apr 2017, 12:08 PM

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 ..

 

 

e is created for :
e is created for :
Can anyone explain to me
Can anyone explain to me

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 26 Apr 2017, 06:47 AM
Hello Wenzl,

This is not a known issue and I was not able to reproduce it on my end.

I used the same command(just with a different function) and the example was still working as expected:

https://www.screencast.com/t/YcjTUSpMcG

I can assume that the issue is caused by a custom factor which we are overlooking at this moment. Please provide a fully runnable example reproducing the issue and I will gladly assist.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Tags
Grid
Asked by
Wenzl
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or