blob: 123caa3ab9b369a4c60cd2ef72fd0ae52fec8e2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<com:TContent ID="body" >
<h1 id="6801">Javascript in Prado, Questions and Answers</h1>
<h2 id="6802">How do I include the predefined javascript libraries?</h2>
<ul><li>Adding libraries in the template
<com:TTextHighlighter Language="prado" CssClass="source">
<com:TClientScript UsingPradoScripts="effects" />
</com:TTextHighlighter>
</li>
<li>Adding libraries in PHP code
<com:TTextHighlighter Language="php" CssClass="source">
$this->getPage()->getClientScript()->registerPradoScript("effects");
</com:TTextHighlighter>
</li>
</ul>
The available packaged libraries included in Prado are
<ul>
<li><tt>prado</tt> : basic prado javascript framework based on Prototype</li>
<li><tt>effects</tt> : visual effects from script.aculo.us</li>
<li><tt>ajax</tt> : ajax and callback related based on Prototype</li>
<li><tt>validator</tt> : validation</li>
<li><tt>logger</tt> : javascript logger and object browser</li>
<li><tt>datepicker</tt> : datepicker</li>
<li><tt>rico</tt> : Rico library</li>
<li><tt>colorpicker</tt> : colorpicker</li>
</ul>
<p>The dependencies for each library are automatically resolved. Components
that require a particular library will also automatically load the necessary libraries.
For example, if you add a TDatePicker component on the page, the <tt>datapicker</tt>
and its dependencies will be automatically included on the page.</p>
<p>See <a href="?page=Controls.ClientScript">TClientScript</a> for options of adding
your custom javascript code to the page.</p>
</com:TContent>
|