Re: Ajax in Datagrid/smarty

From: Date: Tue, 31 Jul 2007 11:18:35 +0000
Subject: Re: Ajax in Datagrid/smarty
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-27767@lists.php.net to get a copy of this message
Hi Great. Thanks. I must bee doing something wrong as I don't get the onclick in the columnSet: php code snip: $datagrid->addColumn(new Structures_DataGrid_Column('Superbruger', 'su', 'su', array('width' => '5%'),null,'printStatus()')); $datagrid->addColumn(new Structures_DataGrid_Column(null, 'id', null, array('width' => '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 => Array (4) link => "/koder.php?orderBy=bladnavn&amp;direc..." name => "bladnavn" label => "Medie" attributes => "width="40%" " 1 => Array (4) link => "/koder.php?orderBy=navn&amp;direction..." name => "navn" label => "Navn" attributes => "width="20%" " 2 => Array (4) link => "/koder.php?orderBy=login&amp;directio..." name => "login" label => "Login" attributes => "width="15%" " 3 => Array (4) link => "/koder.php?orderBy=pswd&amp;direction..." name => "pswd" label => "Kodeord" attributes => "width="15%" " 4 => Array (4) link => "/koder.php?orderBy=su&amp;direction=A..." name => "su" label => "Superbruger" attributes => "width="5%" " 5 => Array (4) link => "" name => "id" label => null attributes => "width="5%" " No onclick here. Any thoughts? Ohh, I don't want that last column called "id" but I use the id as part of a unique <span> id. How can I get data from the bind but not display it in a column? Regards Kaj Schermer Didriksen ---------------------------------------------------------------------------- "New media applications"
macron ApS                                    Telephone: 87959650
Østervænget 5, Assentoft
8900 Randers                                Web: http://www.macron.dk
Denmark --------------------------------------------------------------------------- Den 31/07/2007 kl. 12.33 skrev Olivier Guilyardi:
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/package.structures.structures-datagrid.structures-datagrid-renderer.htmltable.php PS: for these features you need to fetch SDG and drivers from CVS Regards, -- Olivier


« previous php.pear.general (#27767) next »