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

multiple checkboxes in a Column

1 Answer 304 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mujibur
Top achievements
Rank 1
Mujibur asked on 08 Jun 2016, 06:21 AM
I am working on Kendo UI Grid.  I have requirement where role will added dynamically.  So in a single column there should be multiple checkbox. Is there is any way to fix it.

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 08 Jun 2016, 08:14 AM
Hello,

You can have multiple checkboxes in a column by defining them in a template or clientTemplate. Dynamically adding checkboxes in the template however is not supported out of the box by the grid and you may need some additional code in order to handle this.
A suitable approach might be to handle some event fired after a new role has been added - depending on how this happens (e.g. button click, or through some kendo widget).
Then you can iterate over the grid's rows and dynamically add more checkboxes using jquery. Here is a sample approach showing how to add a checkbox to the first cell of each row:
function gridDataBound(e) {
        $(this.tbody).find("tr").each(function () {
            $(this.cells[0]).append('<input type="checkbox" name="myCheckbox" />');
        });
    }

I hope this helps. Let me know if you have any other questions.

Regards,
Marin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Mujibur
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or