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

Kendo Grid editor not opening (auto closing) after kendo upgrade

3 Answers 299 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Uriel
Top achievements
Rank 1
Uriel asked on 05 Sep 2018, 04:50 PM

I have a kendo grid that was working before the following upgrade

2015 Q1 (2014.3.1411) ->  v2017.3.1026

Along with this, we also upgraded from angular1.2 to angular1.6

The grid has some columns like the following example. But after the upgrade the edit input does not show in the column.

If I add a breakpoint right after the appendTo I can see that the editor function actually gets fired, and the inputs is added to the DOM, but then it disapears, (I'm guessing after an angularjs digest cycle or something). If I dont add any breakpoint it happens so fast that it is impossible to notice that the input is actually added to the DOM for a millisecond only the disappear immediately.

What could have happened in the upgrade to break this... or any idea how to fix it?

Thanks

columns: [{
    field: "account",
    title: "accounts",
    editor: function (container, options){
         $('<input id="' + options.field + '" data-bind="value:' + options.field + '" class="form-control" ' + ' />')
             .appendTo(container);
    }
}, ...

3 Answers, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 07 Sep 2018, 02:22 PM
Hi, Uriel,

The Kendo UI Grid built-in editor for strings is a an input with a class "k-textbox" so creating editors as the one in the code snippet should not be necessary.

Nonetheless, it is possible if desired and testing with 2017.3.1026 and AngularJS 1.6.0, there are no issues with such editor:

https://dojo.telerik.com/@bubblemaster/apExiheh

Could you see if there is anything that may be preventing the editor from initializing(beforeEdit, editHandlers, JavaScript error in the console)? Is there anything different that stands out in my example in comparison to the grid which is displaying such behaviour?

If you are able to modify my example to show us how/when the error occurs, that would be most useful.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Uriel
Top achievements
Rank 1
answered on 18 Sep 2018, 06:28 PM

Thanks for the answer in the edit function I had the following and I had to change it to this... not sure what changed between the versions that the original one was not working anymore.

Thanks again

Original

edit: function () {
    if (isCellDisabled(this._editContainer)) {
        this.closeCell();
    }
}

Fix:

edit: function (e) {
    if (isCellDisabled(e.container)) {
        this.closeCell();
    }
}

 

0
Alex Hajigeorgieva
Telerik team
answered on 20 Sep 2018, 02:29 PM
Hi, Uriel,

The original is using a private property this._editContainer and private properties are subject to change. 

It looks like this property is now gone so I am glad you found a solution which uses the public event data (e.container). The Kendo UI team is very cautious of ever causing breaking changes. I trust that this property will not change in the future so the custom code will continue working with next updates.

I would recommend replacing all private methods and private properties that you may have used with public ones to avoid issues in the future.

Let me know if you need a hand.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Uriel
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Uriel
Top achievements
Rank 1
Share this question
or