views:

277

answers:

2

Hi,

I am trying to include a Drupal form element in a table I am generating with theme_table/theme('table',..). Specifically, I am trying to include a submit button with an AHAH attached.

Currently, I am just including as one cell in each row a call to drupal_render to render my dynamically generated AHAH element. The button renders fine, but without the AHAH attached.

So, my question is: is there a way to attach an AHAH to something that is just drupal_rendered?

If not, how else can I attach an AJAX/AHAH call to an element in a theme_table-generated table? I need to allow users to perform certain actions on rows of data in the table but need the page to not refresh.

TIA,
Benjy

+1  A: 

I believe AHAH only works with drupal_get_form(). You'd have to write the AJAX yourself ( handbook page).

Maybe you could save the return value from drupal_get_form() in a variable and pass it to the theme function?

Januz
Thanks - a good pointer in the right direction. Much appreciated.
benjy
A: 

You can do this via theme function and table generation. AHAH will work. The only problem is when you have multiple "tables", things start getting hairy.

Dexter