For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > July 2007 > Re: [PEAR] Ajax in Datagrid/smarty









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] Ajax in Datagrid/smarty
Olivier Guilyardi

2007-07-31, 8:03 am

Hi Kaj,

Kaj Schermer Didriksen wrote:
>
> I want to use ajax in the datagrid that I constructed. I use the smarty
> renderer and I use addColumn to design my columns and I was thinking
> that designing a formatter function and putting it in one of the colums
> is the best way but I'm not sure. Anybody out there done anything simular?


Use the new jsHandler renderer option, it's available in CVS for Smarty. You'll
get "onclick" keys in the the columnSet Smarty variable.

Also look at the simple AJAX example:
http://pear.php.net/manual/en/packa...r.htmltable.php

PS: for these features you need to fetch SDG and drivers from CVS

Regards,

--
Olivier
Kaj Schermer Didriksen

2007-07-31, 8:03 am

Hi

Great. Thanks. I must bee doing something wrong as I don't get the =20
onclick in the columnSet:

php code snip:

$datagrid->addColumn(new Structures_DataGrid_Column('Superbruger'
, =20
'su', 'su', array('width' =3D> '5%'),null,'printStatus()'));
$datagrid->addColumn(new Structures_DataGrid_Column(null, 'id', null, =20=

array('width' =3D> '5%')));
$datagrid->setRendererOption('jsHandler', 'updateGrid', true);
$datagrid->fill($smarty);
$smarty->display('koder.tpl');

turning the debugger in smarty on I get this {$columnSet}:

Array (6)
0 =3D> Array (4)
link =3D> "/koder.php?orderBy=3Dbladnavn&direc..."
name =3D> "bladnavn"
label =3D> "Medie"
attributes =3D> "width=3D"40%" "
1 =3D> Array (4)
link =3D> "/koder.php?orderBy=3Dnavn&direction..."
name =3D> "navn"
label =3D> "Navn"
attributes =3D> "width=3D"20%" "
2 =3D> Array (4)
link =3D> "/koder.php?orderBy=3Dlogin&directio..."
name =3D> "login"
label =3D> "Login"
attributes =3D> "width=3D"15%" "
3 =3D> Array (4)
link =3D> "/koder.php?orderBy=3Dpswd&direction..."
name =3D> "pswd"
label =3D> "Kodeord"
attributes =3D> "width=3D"15%" "
4 =3D> Array (4)
link =3D> "/koder.php?orderBy=3Dsu&direction=3DA..."
name =3D> "su"
label =3D> "Superbruger"
attributes =3D> "width=3D"5%" "
5 =3D> Array (4)
link =3D> ""
name =3D> "id"
label =3D> null
attributes =3D> "width=3D"5%" "

No onclick here.
Any thoughts?

Ohh, I don't want that last column called "id" but I use the id as =20
part of a unique <span> id. How can I get data from the bind but not =20
display it in a column?


Regards
Kaj Schermer Didriksen

------------------------------------------------------------------------=20=

----
"New media applications"

macron ApS Telephone: 87959650
=D8sterv=E6nget 5, Assentoft
8900 Randers Web: http://www.macron.dk
Denmark
------------------------------------------------------------------------=20=

---


Den 31/07/2007 kl. 12.33 skrev Olivier Guilyardi:

> Hi Kaj,
>
> Kaj Schermer Didriksen wrote:
>
> Use the new jsHandler renderer option, it's available in CVS for =20
> Smarty. You'll
> get "onclick" keys in the the columnSet Smarty variable.
>
> Also look at the simple AJAX example:
> http://pear.php.net/manual/en/packa....structures-=20
> datagrid.structures-datagrid-renderer.htmltable.php
>
> PS: for these features you need to fetch SDG and drivers from CVS
>
> Regards,
>
> --
> Olivier

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com