Tut2 ses3

376 views
307 views

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
376
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Tut2 ses3

  1. 1. Table Binding <ul><li>Using table data binding, each record can be displayed in a different row of a table. The syntax is: </li></ul><ul><li><table datasrc=“# id ”> </li></ul><ul><li><tr> </li></ul><ul><li><td><span datafld=“ field1 ”></span></td> </li></ul><ul><li><td><span datafld=“ field2 ”></span></td> </li></ul><ul><li></tr> </li></ul><ul><li></table> </li></ul>
  2. 2. Table Binding <ul><li>In the example, id is the name of the data island, field1, field2 are the fields from the recordset. </li></ul>
  3. 3. Page Binding <ul><li>As you add more records to your XML document, a table can become long and unwieldy. One way to fix this is to give the user the option of limiting the number of records displayed at any one time. </li></ul><ul><li>The user can then move forward of backward that number of records at a time. This is called paging . </li></ul>
  4. 4. Page Binding <ul><li>To specify the page size, add the dataPageSize attribute to the <table> tag: </li></ul><ul><ul><li>dataPageSize=“ number ” </li></ul></ul><ul><li>number is the number of records you want displayed in a single page. </li></ul>
  5. 5. Navigating a Table Page <ul><li>A unique identifier must be assigned to a table using the ID attribute before writing a command to navigate a table page. The syntax to do this is: </li></ul><ul><ul><li><table id=“ id”> </li></ul></ul><ul><li>Here, id is the name you assign to the table object. </li></ul><ul><li>This is needed because the commands to navigate the table pages act on the table itself not the recordset. </li></ul>
  6. 6. Table Methods and Properties <ul><li>These figures show some table methods and properties </li></ul>
  7. 7. Table Methods and Properties <ul><li>To run these commands, add the command to the onClick event handler of a <button> tag. For example, to move to the last page in a data table named “StaffTable”, you enter the attribute: </li></ul><ul><ul><li>onClick=“StaffTable.lastPage( )” </li></ul></ul>
  8. 8. Hierarchical Records <ul><li>This figure shows the layout of the EMP2.XML document </li></ul>
  9. 9. Hierarchical Records <ul><li>To bind the Employee fields in the previous slide to a table, you create a table as follows: </li></ul><ul><li><table datasrc=“#Staff_Info” datafld=“Employee”> </li></ul><ul><li><tr> </li></ul><ul><li><td><span datafld=“Name”></span></td> </li></ul><ul><li><td><span datafld=“Position”></span></td> </li></ul><ul><li><td><span datafld=“Phone”></span></td> </li></ul><ul><li>… </li></ul><ul><li></tr> </li></ul><ul><li></table> </li></ul>
  10. 10. Draft of the Final Web Page <ul><li>This figure shows the draft of the final Web page </li></ul>employee information grouped by department
  11. 11. The Final Web Page <ul><li>This figure shows the final Web page </li></ul>

×