summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Advanced/es/Scripts3.page
blob: 37885abba53eeb61c67497d009b5876f42a51de7 (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
36
37
38
39
<com:TContent ID="body" >
<h1 id="6801">Javascript in PRADO, Questions and Answers</h1>
<h2 id="6802">How do I include the Javascript libraries distributed with Prado?</h2>
<p id="880060" class="block-content">The javascript libraries distributed with Prado can be found in the
<tt>framework/Web/Javascripts/source</tt> directory. The <tt>packages.php</tt>
file in that directory defines a list of available package names available
to be loaded. They can be loaded as follows.
</p>
<ul id="u1" class="block-content"><li>Adding libraries in the template
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_850268">
&lt;com:TClientScript PradoScripts="effects" /&gt;
</com:TTextHighlighter>
    </li>
    <li>Adding libraries in PHP code
    <com:TTextHighlighter Language="php" CssClass="source block-content" id="code_850269">
$this->getPage()->getClientScript()->registerPradoScript("effects");
    </com:TTextHighlighter>
    </li>
</ul>
The available packaged libraries included in Prado are
<ul id="u2" class="block-content">
    <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>colorpicker</tt> : colorpicker</li>
</ul>

<p id="850761" class="block-content">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 <tt>TDatePicker</tt> component on the page, the <tt>datepicker</tt>
and its dependencies will be automatically included on the page.</p>

<p id="850762" class="block-content">See <a href="?page=Controls.ClientScript">TClientScript</a> for options of adding
	your custom Javascript code to the page.</p>

</com:TContent>