Make certain columns editable for parent and certain only for children

4 posts, 0 answers
  1. Labhesh
    Labhesh avatar
    26 posts
    Member since:
    Sep 2015

    Posted 05 Jul 2018 Link to this post

    Hi, 

     

    I am looking to configure my treelist so that certain columns are editable for only "parent" node while some others are editable for only children.

     

    I see that TreeListDataSource.fields can have "editable" set as true or false, but is there a way to conditionally set them to true or false, based on whether I am dealing with parent or child row?

    Say I have the following columns A, B, C, D, E.

     

    I want A, and B to be editable at the parent level, while C, D and E should be editable at children level

     

    Thanks,

    Labhesh

     

  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1016 posts

    Posted 09 Jul 2018 Link to this post

    Hi, Labhesh,

    Currently, the Kendo UI TreeList does not have a columns editable configuration like the Kendo UI Grid which can be very convenient for cases like this one.

    So the only way I can think of that you may achieve the desired result is to use the columns editor template as a function and decide whether to render an editor or just return the text instead:

    {
      field: "FirstName",
      editor: function(container, options) {
        if(options.model.parentId){
          var input = $("<input class='k-textbox'/>");
          input.attr("name", options.field);
          input.appendTo(container);
        } else {
          return container.text(options.model[options.field]);
        }
      }
    },

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

    We are currently working on the Kendo UI TreeList editing improvements and it seems that adding a columns editable option as a function could make a great addition to the Kendo UI TreeList and I do not see it as a feature request in the UserVoice portal:

    http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback?category_id=170298

    The items which are popular get pushed in our planning and future implementation. 

    Let me know what you think about the suggested approach.

    Kind Regards,
    Alex Hajigeorgieva
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Labhesh
    Labhesh avatar
    26 posts
    Member since:
    Sep 2015

    Posted 09 Jul 2018 in reply to Alex Hajigeorgieva Link to this post

    Thanks Alex, I ended up doing what you suggested i.e. using custom editor. 

    Yes - having a "function" to make columns editable in tree list seems a good idea. Could you please add it to the set of requests and see if it gets enough upvotes to be in a future release?

     

    Regards,

     

    Labhesh

  4. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1016 posts

    Posted 10 Jul 2018 Link to this post

    Hello, Labhesh,

    I have some good news for you!

    I have spoken with the team and since a lot of work is being done now, the columns editable as a function has been planned as well and will be live and ready to use with our next major release.

    At this point, you will be able to simplify and clean up the editor logic that we discussed.

    Kind Regards,
    Alex Hajigeorgieva
    Progress Telerik
    Try our brand new, jQuery-free Angular 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