Grid not working on Custom Command

2 posts, 0 answers
  1. Wenzl
    Wenzl avatar
    3 posts
    Member since:
    Apr 2017

    Posted 24 Apr Link to this post

    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
  2. Stefan
    Admin
    Stefan avatar
    1257 posts

    Posted 26 Apr Link to this post

    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 visualization (charts) and form elements.
Back to Top