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

4 posts, 0 answers
  1. Uriel
    Uriel avatar
    2 posts
    Member since:
    Oct 2017

    Posted 05 Sep 2018 Link to this post

    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);
        }
    }, ...
  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1081 posts

    Posted 07 Sep 2018 Link to this post

    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.
  3. Uriel
    Uriel avatar
    2 posts
    Member since:
    Oct 2017

    Posted 18 Sep 2018 in reply to Alex Hajigeorgieva Link to this post

    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();
        }
    }

     

  4. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1081 posts

    Posted 20 Sep 2018 Link to this post

    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.
Back to Top