override addCheckboxList add htmlId element

matc1
Member | 19
+
0
-

Hi everybody is it possible to override addCheckboxList function and add single htmlId for every single checkbox item of the group list?
I'm e unable to set different htmlId for every checkbox item of the list.
I cant'use manual rendering.
Thank's a lot.

David Matějka
Moderator | 6445
+
+2
-

hi, you can set id attribute for each input using this:

		$form->addCheckboxList('test', null, ['a' => 'hello a', 'b' => 'hello b'])
			->getControlPrototype()->addAttributes(['id:' => ['a' => 'idA', 'b' => 'idB']]);
matc1
Member | 19
+
0
-

Great Thanks!