Closed (fixed)
Project:
Hierarchical Select
Version:
6.x-3.x-dev
Component:
Documentation
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
1 Mar 2009 at 01:40 UTC
Updated:
17 Apr 2009 at 17:09 UTC
On my cursory reading of the docs and code in hs, it seemed that the key to getting a
format HS was to combine $element['#config']['multiple'] = 1 and/or $element['#config']['save_lineage']. This wasn't the case.
It took a while to discover that the key was actually just to set $element['#size'] to a value higher than 1.
It would be helpful if API.txt or the examples at Wim's site could make this connection explicit, as I didn't realise that Drupal used the same term ('#size') to refer to both horizontal sizes (textfield) and vertical (select).
http://drupal.org/node/212014 requested this.
Thanks!
Comments
Comment #1
xurizaemonNB - the link above references the request for this feature to be implemented, not documented.
Comment #2
wim leersAgreed. I only found out about the #size property myself very, very late. However, your title and interpretation is wrong :)
Setting #size to >1 does *not* generate #multiple = TRUE selects! Give it a try: you won't be able to select multiple options, even when JS is disabled. HTML also has a size attribute for the select element, this is not something Drupal-specific.
I still agree that the documentation should clarify this though, we can't expect everybody to know every detail of the HTML spec :)
Comment #3
xurizaemonThat is interesting, thanks Wim, and makes more sense of why Drupal's parameter is named such.
I had thought that
referred to both the visible rows and whether multiple items were selectable.
As you say,
is quite legal. multiple=true seems to imply size=>1, and for that reason I've been abusing multiple=true for a disturbingly long time. Glad to be corrected!
HS is a simply awesome module, Wim. Very much appreciate your efforts.
Comment #4
xurizaemonUgh - my reply reset the fields to the old values. Reverting, but can't reassign to Wim.
Comment #5
wim leersComment #6
wim leersCommitted.
D6: http://drupal.org/cvs?commit=186684
D5: http://drupal.org/cvs?commit=186688
Comment #8
ptoly commentedI love HS. Great work!
However I need to set a static height for the HS. However I can't make heads or tails of which file I need to modify..
Where is #size? Where is #multiple?
Reading between the lines it is a Drupal parameter that needs to be modified. I'm not at all clear where I should change the settings.
Any help appreciated!