Thanks for the link to your table editting demo... A very useful
example.

Check out this site for various DHTML widgets: http://webfx.eae.net/

Wim

> -----Original Message-----
> From: Robert [mailto:[EMAIL PROTECTED]] 
> Sent: Sunday, September 01, 2002 9:57 AM
> To: [EMAIL PROTECTED]
> Subject: (Emb)perl & JavaScript
> 
> 
> Hi,
> 
>   I'd like to have a (emb)perl library that would hide the JavaScript
> ugliness behind couple of simple Perl calls, but I can't find anything
> interesting. Ideally it would work in the Embperl::Form::Validate way,
> but offered more advanced stuff like (database) table edit widget,
> inteligent date widget, menu tree widget etc. Have anybody heard about
> such thing? If not would there be any person interested in 
> using and/or
> creating it? Here's an example of what I'm talking about: To 
> edit bigger
> part of the (database) table at once, as opposed to the 
> editing it line
> by line (eg, editing lines on the invoice), you would write something
> like example below (working demo is on
> http://www.robert.cz/misc/table-edit-demo.html ). Any comments?
> 
> - Robert
> 
> PS1 I use something close to the demo code in a real life 
> project and it
> seems to work quite fine. Now I want more... ;-)
> PS2 You need IE5+ or Moz1+ to view the demo.
> 
> 
> ==============================================================
> ==============================================
> 
> [-
> 
> use TableEdit;
> 
> # init table data with DBIx::Recordset or whichever way you want, just
> make sure it's array of hashes
> # *set = DBIx::Recordset->Search(...);
> @set = (
>       { id => 101, firstname => 'Gerald',   lastname => 
> 'Richter', age =>
> '36', country => 'DE' },
>       { id => 102, firstname => 'Sherlock', lastname => 
> 'Holmes',  age =>
> '46', country => 'UK' },
>       { id => 103, firstname => 'Robert',   lastname => '',   
>      age =>
> '34', country => 'CZ' },
> );
> 
> @table_def = (
>       { field => 'firstname', title => 'First Name', width => 
> '140', align =>
> 'left' },
>       { field => 'lastname',  title => 'Last Name',  width => 
> '160', align =>
> 'right' },
>       { field => 'age',       title => 'Age',        width => 
> '80',  default
> => '18', },
>       { field => 'country',   title => 'Country',    width => 
> '90',  default
> => 'CZ', 
>               select => [ [ 'CZ', 'DE', 'UK', 'US' ], [ 
> 'Czech Rep.', 'Germany',
> 'U.K.', 'USA' ] ] },
>       { field => 'id', title => 'Id', width => '0' },
> 
> if ($req_rec->method eq 'POST') {
>       @tmp = @{ fdat2rset( \%fdat, \@table_def ) };
>       foreach $r (@tmp) {
>               # save data line by line with DBIx::Recordset 
> or whichever way you
> want 
>               # $set->Update({ $record }) if $r->{status} eq 'UPDATE';
>               # $set->Delete({ $record }) if $r->{status} eq 'DELETE';
>               # $set->Insert({ $record }) if $r->{status} eq 'INSERT';
>       }
>       # exit & redirect back to the edit mode
> }
> 
> -]
> 
> 
> <body>
> 
> <h1>TableEdit Demo</h1>
> 
> <form method=post>
>       <input readonly onClick='mlAddLine(); return false;' 
> class=mlButton
> value='NEW LINE'>
>       [+ table_edit( \@table_def, \@set ) +]<hr>
> <input type=submit class=mlButton value='SAVE FORM'>
> </form>
> </body>
> 
> ==============================================================
> ==============================================
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to