|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sorting your Domino views with JavaScript (continued)
The second table column displays the value in the Author field.
The Column 5 formula ends the table row:
Finally, I enabled the "Treat view contents as HTML" property and saved the view.
Create a form to show the view through Next I created a $$ViewTemplateDefault form to display the view created above. I added the following HTML code to the top of the form.
<table border="0" width="100%">
<tr>
<td width="50%"><a href="#" onClick="javascript:sortTable('Title');return true">Title</a></td>
<td width="50%"><a href="#" onClick="javascript:sortTable('Author');return true">Author</a></td>
</tr>
</table>
<hr>
|
This table consists of one row that has two links. These links are our column headings which when clicked will sort the view by column using the values assigned to the column's "abbr" attrbibute.
Next I added the following:
<span id="contents">
<table width="100%">
|
On the next line I added the "$$ViewBody" field (this is where Domino will render the view) followed on the next line with the code to close the view table.
Notice that the view table is itself wrapped in the span block "contents". It is the "innerHTML" value of this block that is rewritten each time the view contents are sorted.
I then set the Pass-Thru HTML property of all the HTML on the form.
Add the sorting routines Next, I added the JavaScript to the $$ViewTemplateDefault form. The following code was added to the onLoad event.
var booktitles = getTableElements("td","title","booktitle");
var authors = getTableElements("td","title","author");
var rows = getTableElements("tr","title","row");
for (i=0; i<rows.length; i++){
contents[i] = {booktitle:booktitles[i].getAttribute("abbr"),
author:authors[i].getAttribute("abbr"),
details:"<tr title=row>" + rows[i].innerHTML + "</tr>"
}
}
|
As the form loads it builds three arrays. The first two "booktitles" and "authors" contain the HTML output from Columns 3 and 4 in our web view. The third array "rows" contains the HTML for each table row in full.
These three arrays are then used to build another array "contents" but in doing so, only the "abbr" values are extracted from the booktitles and authors array elements. The first entry in the contents array "contents[0]" will look something like this once the page loads.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.
Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.
Learn how to easily clean up your address book. |
-- Advertisement --
Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
- Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
- User friendly aproach, using a point and click access to features
- Reports from any Lotus Notes databases
- Runs reports through a Notes client, web browser and scheduled basis
- Allows use of LotusScript for advanced data manipulation
- Enables self service reporting capabilities to end-users
Learn more at www.integra4notes.com. |
|
|
|
|
|
|
|
|
|
|