/lenasys/0.1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/0.1

« back to all changes in this revision

Viewing changes to Code Viewer Alt/AJAX/AjaxDemoApp3_getResources_description.html

  • Committer: elof.bigestans at gmail
  • Date: 2013-04-04 09:29:10 UTC
  • mto: This revision was merged to the branch mainline in revision 13.
  • Revision ID: elof.bigestans@gmail.com-20130404092910-2h88nt2vtjfabq27
* Added description files for code examples. These were removed on a previous clean-up job, when they shouldn't have been.
* Modified php files to reflect new description files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<span class="description">
 
2
<br>
 
3
<div class="descriptionheading">Overview</div>
 
4
 
 
5
The resource search is a variation on a classical search form. A number of optional search terms are entered and a result is retrieved based on those parameters.
 
6
 
 
7
<div class="descriptionheading">searchResources</div>
 
8
The function called <span class="interestingdescription">searchResources</span> is executed by the keyup and onchange events for the text boxes in the form. 
 
9
Events connected to text boxes are suitable for this type of application since attaching code to those events allows the capture of text written 
 
10
into a dialog box while the user keeps typing.<br>
 
11
The search terms are collected from the form and passed directly to the api. The 
 
12
 
 
13
<br><br>
 
14
 
 
15
<div class="descriptionheading">showResources</div>
 
16
 
 
17
The other function <span class="interestingdescription">showResources</span> is nearly identical to the result function of the previous example <a href='AjaxDemoApp2_getCustomerBookings.php'>getCustomerBookings</a>. 
 
18
 
 
19
<br><br><div class="descriptionheading">getResources</div>
 
20
 
 
21
The <span class="interestingdescription">booking/getresources_XML.php</span> performs a search using a set of search terms.  
 
22
"None" is given, that search term is ignored. <br> The three first terms i.e. name, location and company use a logical or if more than one term is given.
 
23
The full text search works in isolation from the other terms.
 
24
 
 
25
<br><br><div class='exampleheading'>Call Example:<br><br>
 
26
<pre class="codeexample">
 
27
$.ajax({
 
28
        type: 'POST',
 
29
        url: 'booking/getresources_XML.php',
 
30
        data: { name: escape(document.getElementById("resName").value),
 
31
                location:  escape(document.getElementById("resLocation").value),
 
32
                company: escape(document.getElementById("resCompany").value),
 
33
                fulltext: escape(document.getElementById("resFulltext").value) },
 
34
        success:  showResources
 
35
});
 
36
</pre>
 
37
</div>
 
38
 
 
39
<br>
 
40
 
 
41
<br><div class='exampleheading'>Returned Data Example:<br>
 
42
<pre><span class="codeexample">
 
43
&lt;resources&gt;
 
44
&lt;resource 
 
45
    id='1001'
 
46
    name='Pilkington Inn'
 
47
    company='Sunside Hotels'
 
48
    location='Manchester'
 
49
    size='15'
 
50
    cost='350'
 
51
 /&gt;
 
52
&lt;/resource&gt;
 
53
</span>
 
54
</div>
 
55
                                                                                                                                        
 
56
</span></pre>