Last Updated: 09 Mar 2023 11:16 by Danijela
Created on: 07 Mar 2023 10:58
Category: UI for ASP.NET Core
Type: Feature Request
TreeList bind data to checkbox just like any other column

I am using TreeList for setting permissions. It seemed a perfect choice until I realized that state of ALL the checkboxes is set to either true or false.

I would like to be able to select checkbox based on the value of record i.e. to be able to save it's state in database, retrieve it, and batch update it.

I know that this behavior can be simulated / achieved by using javascript, but it would be so much better, easier and neater to have it data bound just like all the other columns.

For example, I have an organisational structure on the picture below. We can set permissions on any level. 

I imagine that the syntax could be something like:

    .Columns(columns =>
        columns.Add().Field(e => e.Opis).Width(250);
    .DataSource(dataSource => dataSource
        .Read(read => read.Action("ObjektiTree_Read", "Admin"))
        .Model(m => {
            m.Id(f => f.Id);
            m.ParentId(f => f.ParentId);
            m.Selected(f => f.Selected);
            m.Field(f => f.Opis);

I sincerely hope you would consider this update, as I cannot think of a scenario when I would use checkboxes that are all the same state.

Thank you in advance.

Posted on: 09 Mar 2023 11:16

Sorry, Expanded actually works. (I couldn't delete my previous comment.)

m.Expanded(f => f.Expand);
Posted on: 09 Mar 2023 10:41

I would also like Expand to be driven by database as well.

For example, I would collapse the nod that has no selected children, otherwise I would expand it so that selections are visible.

So instead of having:


I would like something like this:

m.Expanded(f => f.Expand);