From 91c4292a8063dd2d7a27e7629c015faa4bf052d6 Mon Sep 17 00:00:00 2001 From: wei <> Date: Wed, 5 Jul 2006 01:43:07 +0000 Subject: Upate TClientScript --- .../protected/pages/Advanced/Scripts3.page | 3 ++ .../protected/pages/Controls/ClientScript.page | 52 ++++++++++++++++++++++ .../protected/pages/Controls/Standard.page | 4 ++ 3 files changed, 59 insertions(+) create mode 100644 demos/quickstart/protected/pages/Controls/ClientScript.page (limited to 'demos') diff --git a/demos/quickstart/protected/pages/Advanced/Scripts3.page b/demos/quickstart/protected/pages/Advanced/Scripts3.page index 9883f43e..123caa3a 100644 --- a/demos/quickstart/protected/pages/Advanced/Scripts3.page +++ b/demos/quickstart/protected/pages/Advanced/Scripts3.page @@ -29,4 +29,7 @@ that require a particular library will also automatically load the necessary lib For example, if you add a TDatePicker component on the page, the datapicker and its dependencies will be automatically included on the page.

+

See TClientScript for options of adding + your custom javascript code to the page.

+ \ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/ClientScript.page b/demos/quickstart/protected/pages/Controls/ClientScript.page new file mode 100644 index 00000000..5dab41d5 --- /dev/null +++ b/demos/quickstart/protected/pages/Controls/ClientScript.page @@ -0,0 +1,52 @@ + + +

TClientScript

+ +

Including Bundled Javascript Libraries in Prado

+

+TClientScript allows javascript code to be insert or linked to the +page template. Prado is bundled with a large library of javascript functionality +including effects, AJAX, basic event handlers, and many others. The bundled +javascript libraries can be linked to the current page template using the +UsingPradoScripts property. Multiple bundled javascript libraries +can be specified using comma delimited string of the name of javascript library +to include on the page. For following example will include the "ajax" and "effects" library. +

+ +<com:TClientScript UsingPradoScripts="ajax, effects" /> + + +

+ The available bundled libraries included in Prado are +

+

+

The dependencies for each library are automatically resolved. That is, + specifying, say the "ajax", will also include the "prado" library.

+ +

Including Custom Javascript Files

+

Custom javascript files can be register using the ScriptUrl property. +The following example includes the javascript file "test.js" to the page. In this case, the file +"test.js" is relative the current template you are using. Since the property value is +dynamic asset tag, the file "test.js" will be published +automatically, that is, the file will be copied to the assets directory if necessary. +

+ +<com:TClientScript ScriptUrl=<%~ test.js %> /> + +

You can include javascript files from other servers by specifying the full URL string in + the ScriptUrl property.

+ +

Including Custom Javascript Code Blocks

+

Any content within the TClientScript control tag will be considered as + javascript code and will be rendered where it is declared.

+ +
\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Controls/Standard.page b/demos/quickstart/protected/pages/Controls/Standard.page index 156b39e5..086ba293 100644 --- a/demos/quickstart/protected/pages/Controls/Standard.page +++ b/demos/quickstart/protected/pages/Controls/Standard.page @@ -11,6 +11,10 @@ TCheckBox represents a checkbox on a Web page. It can be used to collect two-state user input. +
  • + TClientScript adds javascript code to the page. +
  • +
  • * TColorPicker represents an input field taking color values via a color dialog.
  • -- cgit v1.2.3