This patch allows you to provide an #attributes array in your #options of a tableselect type to do things like add classes to rows, etc.
Example:
$options[$name]['title'] = "my option"
$options[$name]['type'] = "something else"
$options[$name]['#attributes'] = array ('class' => 'super duper');
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | tableselect_row_attributes.diff | 1.96 KB | JacobSingh |
| tableselect_row_attributes.diff | 1.47 KB | JacobSingh |
Comments
Comment #1
JacobSingh commentedComment #3
dries commentedThis patch looks simple, but I'd like to see us extend the PHPdoc a bit to explain why you might care about passing in an '#attributes' array. Should be RTBC with more extensive documentation.
Comment #4
JacobSingh commentedI think those are E_NOTICE exceptions... this should fix them.
Also, added an example and some docs. Real docs should actually go on the form api reference page though.
Comment #5
catchLooks good, just needs tests to pass and that documentation.
Comment #6
JacobSingh commentedSetting to needs review... does the bot run on needs work?
Comment #7
catchwhoops, cross-posted, and no it doesn't.
Comment #8
Bojhan commentedMr. Bot?
Comment #9
JacobSingh commentedWhat is up with the Bot?
Comment #10
Anonymous (not verified) commentedLooks good. Let's get this functionality in. :)
(And I'm not a Bot!) :P
Comment #11
tic2000 commentedSince you are not a bot ;)
Comment #12
dries commentedIf someone runs the tests locally, that is good enough too. Not sure Joshua did.
Comment #13
dries commentedTesting was OK, see http://testing.drupal.org/pifr/file/1/tableselect_row_attributes_1.diff (thanks DamZ) but somehow not reported on d.o.
Comment #14
dries commentedCommitted to CVS HEAD. Thanks!
Comment #15
dries commentedCommitted to CVS HEAD. Thanks!