| Page 1 of 1 | [ 4 posts ] |
|
Is there a way to use the cellMouseoverEvent to highlight a cell in a table inside an expandable row?
http://developer.yahoo.com/yui/examples ... basic.html I'm trying to use the datatable's built in events to handle some things inside the expanded rows, but I'm unsure how to do that. The basic structure we're using inside the expandable rows is: Code: <tr class="yui-dt-expansion"> <td colspan="12" class=""> <div class="yui-dt-liner"> <table> <thead><tr><th>header</th><th>header</th></tr></thead> <tbody><tr><td>data</td>data<td></td></tr></tbody> </table> </div> </td> </tr> |
|
You haven't provided any details about how you insert the sub-table in the expanded rows. If you just insert an additional HTML Table element as you indicated it won't have any granularity of DataTable capability because it is simply an HTML DOM Table. You could do it by defining unique DOM "id"s to elements and then adding a bunch of listeners, but that would be cumbersome and prone to memory leaks.
If you really want to embed a sub-table as a YUI DataTable within a parent DataTable, I suggest you review Satyam's example. http://www.satyam.com.ar/yui/2.8.0/nested1.html His approach inserts a DataTable within the expansion row of the parent Table (call it a child table). The child table is a true YUI DataTable with all the API capability available to do as you please. Hope it works for you, Todd |
|
thanks for the reply
no, the subrow tables are not built as yui datatables - they're built much the way the original expandable rows table is built, using YAHOO.lang.substitute( row_template, item, processor ); So again, is there a way to harness the yui datatable events such as cellMouseoverEvent for elements within a subrow, or can I use yui.event.delegate to augment the datatable's own event listeners? |
|
The lowest level of element that you can get to with DataTable events is cell level (cellMouseoverEvent, etc...). The target returned from this event is the DIV liner in the TD element. You might be able to set a delegate on elements within a subrow (i.e. within the DIV inside TD), but you will need to come up with a method to define unique ID's or class names to use to distinguish which one is the target.
|
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group