2009年10月24日星期六

[fw-mvc] [Zend_Form] howto: multiCheckbox with collapsible lower elements‏

I create a series of checkboxes in a multiCheckbox element from Zend_Form. These checkboxes are rendered in one definition list.
Since this list is to long, I want to be able to collapse the lower part of the list.

I can imagine two solutions.

  1. Generate two different definition lists, put adiv in between
  2. Generate a single definition list, with the lower part nested in a dd. Example:


 <dl> 	<dt>one</dt> 	<dd>checkbox</dd> 	<dt>two</dt> 	<dd>checkbox</dd> 	<dt>..</dt> 	<dd>checkbox</dd> 	<dt>show more</dt> 	<dd> 		<dl> 			<dt>six</dt> 			<dd>checkbox</dd> 			<dt>seven</dt> 			<dd>checkbox</dd> 			<dt>..</dt></dd> 		</dl> </dl> 

I don't know what is semantically more correct.
Anyways, my question is: how can I solve this in Zend_Form?

  1. Is this what displaygroups are for?
  2. Do I need to extend the FormElements decorator? How? With a different View script?
  3. other way...?

I am a bit puzzled by the complexity and possibilities of Zend_Form. What is best practice? Any help is greatly appreciated.


View this message in context: [Zend_Form] howto: multiCheckbox with collapsible lower elements‏
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: