[ajax_inPlaceEditor]

Description

Link: [ajax_inPlaceEditor]
Author: deco rior
Category: Custom Tag
Version: 7.x
License: Public Domain
Posted: Mar. 09, 2006
Updated: Mar. 09, 2006
More by this author...
This tag does what Ajax.InPlaceEditor does in scriptaculous. It saves you from having to write any javascript (woohoo!). You must have scriptaculous field (www.script.aculo.us.com) or lasso 8.5 include files in the page. Bascially you click on the text an it becomes editable. THIS TAG IS NOT SECURE Basically it will pass the table name. and paramter to update to a file called "update.lasso" This lasso code should do an inline update. This will update the field in real time without submitting a form.

Parameters

-div string, optional The div surrounding the text if you want to stick it somewhere else
-field string, optional field to update
-file string, optional file doing the updating
-id integer, optional pk of the record to update
-path string, optional path to ajax directory
-row string, optional creates a text box instead of an input field
-size integer, optional size of the text box
-table string, optional table to update

Sample Usage

[Ajax.inPlaceEditor: 
    -id=$theMember->(find:'id'), 
    -table='members', 
    -field='first_name', 
    -size = 10, 
    -path='../ajax/', 
    -file='update.lasso'][$myName]
[/Ajax.inPlaceEditor]
						

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
1
2
3
4
5
6
7
8
define_tag: 'Ajax.inPlaceEditor',-container,-required='id',-optional='pair';
if:(named_param:'-div');local:'myDiv' = (named_param:'-div');else;local:'myDiv' = (lasso_uniqueID);/if;
if:(named_param:'-size');local:'mySize' = (named_param:'-size');else;local:'mySize' = 6;/if;
if:(named_param:'-rows');local:'myRows' = (named_param:'-rows');else;local:'myRows' = 1;/if;
return:'<span style="color:black;" id="' + #myDiv  +'">' + run_children + '</span><script type="text/javascript" language="javascript">
new Ajax.InPlaceEditor(\'' + #myDiv + '\',\'' + (named_param:'-path') + (named_param:'-file') + '?-session=member:' + (session_id:-name='member') + '&tbl_name=' + (named_param:'-table') + '&fld_name=' + (named_param:'-field') + '&id_value=' + (named_param:'-id') +'\',{rows:' + #myRows + ',size:' + #mySize + ',ajaxOptions: {method: "get"}});</script>';
/define_tag;

 

Related Tags



Comments

05/30/2008, Greg Hemphill
script.aculo.us URL
BTW the URL is "script.aculo.us" not "www.script.aculo.us.com"
Email:


Password:



Newest

Most Popular

Support tagSwap.net