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

Edit event only fires once?

1 Answer 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Klas
Top achievements
Rank 1
Klas asked on 23 Oct 2012, 09:10 AM
I have a problem where I need to have the foreign key dropdowns disabled while editing. I have used the default Event for edit but it only seem to fire once.

.Events(e => e.Edit("edit"));

Like this.


    function edit(args) {
        var insertMode = args.model.isNew();
        if (insertMode == false) {


            var dropdownlist = $("#KeyFigureId").data("kendoDropDownList");
            dropdownlist.enable(false);


            var dropdownlisttwo = $("#DimensionOneId").data("kendoDropDownList");
            dropdownlisttwo.enable(false);
            
            var dropdownlist3 = $("#DimensionTwoId").data("kendoDropDownList");
            dropdownlist3.enable(false);


            var dropdownlist4 = $("#DimensionThreeId").data("kendoDropDownList");
            dropdownlist4.enable(false);
  
        }
    }

Any chance we could get a separate template for Insert and Edit in the future? (also asked in the webinar).

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 26 Oct 2012, 08:30 AM
Hello Klas,

Having different templates for insert and edit is not supported by the Grid. What I can suggest you is to use the edit event of the Grid and check whether the e.model.isNew() method returns true or false to distinguish between the edit and insert. Then you can hide the DropDownList with jQuery depending on that variable.

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