This is a migrated thread and some comments may be shown as answers.
Make certain columns editable for parent and certain only for children
3 Answers 17 Views
This is a migrated thread and some comments may be shown as answers.
Labhesh
Top achievements
Rank 1
Labhesh asked on 05 Jul 2018, 08:43 PM

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

 

3 Answers, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 09 Jul 2018, 02:16 PM
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.
0
Labhesh
Top achievements
Rank 1
answered on 09 Jul 2018, 02:45 PM

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

0
Alex Hajigeorgieva
Telerik team
answered on 10 Jul 2018, 12:18 PM
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.
Asked by
Labhesh
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Labhesh
Top achievements
Rank 1
Share this question
or