My assumption is you want the data
attribute added to the option
attribute when it's rendered on the page.
The short answer is this is not supported.
The long answer is you would have create your own field type and ship it with the extensions. This is done in many core extensions (try Banners in the administrator, for example, and look in the com_banners/models/fields
folder.
What I'd probably do is take a complete copy of the JFormFieldList
class and rename is to something like JFormFieldMydatalist
in a file called mydatalist.php
. You are then going to have to experiment with the getOptions
method to add the new attribute and also change the getInput
method.
In the absence of more detail about your extensions, that's the best I can do.