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

Is nested rows compatible with selectable rows?!

1 Answer 267 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 30 Mar 2020, 12:16 AM

We've got a column within a table which displays multiple rows within a row.I'm trying to find out if you're "selectable" option on Grid will work with next rows at all.

Check the stackblitz out :https://stackblitz.com/edit/angular-ajpix8-pe9eyr

There's a few questions I have here;

  1. Is there anyway of rendering the inputs automatically using your plugin rather than using the ngFor loop that I've put in to achieve this?
  2. When the kendoGridSelectAllCheckbox is selected is there anything the API that can activately select all the inputs that have been rendered or will this have to be done with some custom work attached to some type of change listener?!
  3. Is there a better way to handle nested rows than this way?!

Thanks, look forward to hearing from you.

1 Answer, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 31 Mar 2020, 09:03 AM

Hi Rob,

Thank you for the demonstrated example.

To begin with, we provide templates for specific locations, such as the Grid cell contents, which allow to be customized. Whenever a template is used the developer has full control over the added HTML and/or CSS for implementing the required behavior. Thus, the implemented approach of using the Angular *ngFor directive to render input elements and create a kind of sub rows using the KendoGridCellTemplate is proper by itself. But it cannot benefit from the built-in selection features of the Grid. The example demonstrates two rows, thus if the selection is enabled there can be a total of two rows selected.

There seem to be other approaches that could be overtaken for this case. For example, instead of having two inputs of type checkbox for Chang in the same row, that data item could be represented by two separate items. That will add two rows in the Grid and the built-in features of the Grid will be available to be used:

https://stackblitz.com/edit/angular-ajpix8-jxztqg?file=app/app.component.ts

Another option would be to render the colors in a MultiSelect component where the user can select all or some of them:

https://stackblitz.com/edit/angular-ajpix8-1y3tks?file=app%2Fapp.component.ts

I hope the provided information helps. Please let me know in case further assistance is required for this case. Thank you. 

Regards,
Svetlin
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Rob
Top achievements
Rank 1
Answers by
Svet
Telerik team
Share this question
or