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

How to use Datasource in CheckBoxGroup

2 Answers 964 Views
CheckBoxGroup
This is a migrated thread and some comments may be shown as answers.
Saket
Top achievements
Rank 1
Saket asked on 26 Jan 2021, 07:35 AM
How can i use DataSource in CheckboxGroup instead of static data items ?

In below code instead of hardcoded items i want to use the Datasource so that the Checkbox get rendered based on data returned by API.

I tried to put "dataSource" element instead of items but no luck

Can you let me know how we can achieve this ?

                 {
                        field: "CheckBoxGroup",
                        editor: "CheckBoxGroup",
                        label: "Select Status:",
                        validation: { required: false },
                        editorOptions: {
                            items: ["English", "Russian", "Spanish"],
                            layout: "horizontal",
                            labelPosition: "before"
                        }
                    }

2 Answers, 1 is accepted

Sort by
1
Will
Top achievements
Rank 1
answered on 27 Jan 2021, 02:19 PM
I don't believe this is possible yet due to the check box group being a new control.
1
Neli
Telerik team
answered on 28 Jan 2021, 06:24 AM

Hello Saket,

I have already replied in the support thread regarding the same issue and received your reply. However, as it could be helpful to the other users I will paste my reply below as well:

I am afraid that CheckBoxGroup does not provide a dataSource configuration option for remote binding. In case the remote data returns an array of string or an array of checkbox items, you could use the items option to configure the checkboxes. In the Dojo linked here, the checkboxes in the CheckBoxGroup are configured through an object property. 

In case you think that binding the CheckBoxGroup to remote data would be a valuable enhancement to the widget I would encourage you to log your idea in our official Feedback Portal. Depending on the popularity the issue gains in the community, it could be considered for implementation in the future. 

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
CheckBoxGroup
Asked by
Saket
Top achievements
Rank 1
Answers by
Will
Top achievements
Rank 1
Neli
Telerik team
Share this question
or