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

Can I disable the details template for a new row in the outer Kendo grid?

1 Answer 319 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 31 May 2013, 08:17 PM
 I have a grid with a details template (i.e outer grid with an inner grid).

My outer grid has "Create" functionality. When I add a new row I am able to expand the inner grid before saving, and this causes an error in the backend, because the new row is not saved and does not have an id yet.

Is there a way to disable the details (inner grid expansion) for a new row?

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 04 Jun 2013, 11:42 AM
Hello Patrick,


To achieve this, you should bind to the edit event of the Grid, which is fired when the Grid enters edit mode. In the event handler you could check if the model is new (i.e. the current operation is create and not update) and prevent the click of the hierarchy cell.
E.g.
function edit(e) {
    if (e.model.isNew()) {
        $(".k-grid-edit-row").on("click", ".k-hierarchy-cell", function (e) {
            e.stopPropagation();
        });
    }
}

I hope that this information was helpful for you.

 

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Patrick
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or