2 messages in com.googlegroups.google-mashup-editor[gme] Re: Using <gm:toggle/>
FromSent OnAttachments
Cor-Paul Bezemer14 Apr 2008 08:06 
Jason25 Apr 2008 11:57 
Subject:[gme] Re: Using <gm:toggle/>
From:Jason (gmej@google.com)
Date:04/25/2008 11:57:09 AM
List:com.googlegroups.google-mashup-editor

I think your best bet here is to roll your own solution using JavaScript similar to the sample below. It only handles expansion so it's not a true toggle, but you're more than welcome to use it as a starting point.

Happy mashing! - Jason

<gm:page title="My App" authenticate="false">

<script> function clickHandler(elmt) { var tbody = elmt.parentNode; var rows = tbody.childNodes; for (var i=0; i<rows.length; i++) { if (rows[i].className && rows[i].className.indexOf('gm- toggled')!=-1) { rows[i].style.display = 'block'; } } } </script>

<gm:data id="myFeed"> <feed> <entry> <id>1</id> <title>Click to expand</title> <summary>Expanded!</summary> </entry> </feed> </gm:data>

<gm:list data="${myFeed}" selection="false" template="myTemplate"/>

<gm:template id="myTemplate"> <table> <tbody repeat="true"> <tr onclick="clickHandler(this)"> <td><gm:text ref="atom:title"/></td> </tr> <tr class="gm-toggled"> <td><gm:text ref="atom:summary"/></td> </tr> </tbody> </table> </gm:template>

</gm:page>

On Apr 14, 8:06 am, Cor-Paul Bezemer <baby@gmail.com> wrote:

Hi,

Is it possible to use <gm:toggle/> on an element instead of just the black image?

I want to toggle when a user clicks on a table cell rather than just the image, e.g.:

<td><gm:toggle/><gm:text ref="atom:title"></td>

How can I do this?

Best regards, Cor-Paul