srikanthd wrote:

hello Sir/Madem
Thanku for your sorce code, my requirement is when i move the mouse row should be hilighted for example : http://www.common-controls.com/cc/listcontrol/sample101/userBrowse.do
when i click over user list it should take me to new page with selected row as in the case of example.
plzsend the code or tags which satisfy our requirement.
plz send the source code as soon as possible or update the example in your site.
Thanks and Regards
Srikanth D
S/w engineer
email id : [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>

Here's how:

1. Give you table an id attribute - i.e. id="foo".
2. Add the following JavaScript function to your JSP or to an external .js file:


function highlightTableRows(tableId) {
var previousClass = null;
var table = document.getElementById(tableId);
var tbody = table.getElementsByTagName("tbody")[0];
var rows = tbody.getElementsByTagName("tr");
// add event handlers so rows light up and are clickable
for (i=0; i < rows.length; i++) {
rows[i].onmouseover = function() { previousClass=this.className;this.className+=' over' };
rows[i].onmouseout = function() { this.className=previousClass };
rows[i].onclick = function() {
var cell = this.getElementsByTagName("td")[0];
var link = cell.getElementsByTagName("a")[0];
location.href = link.getAttribute("href");
this.style.cursor="wait";
}
}
}


3.  In your JSP, after </display:table> add the following:

<script type="text/javascript">
<!--
highlightTableRows("foo");
//-->
</script>

4. Add a rule to your CSS file that has the .over class referenced in the highlightTableRows function:

/* highlight table row onmouseover */
table tr.over {
   background: #FFFF40;
   border-bottom: 1px solid #C0C0C0;
   border-top: 1px solid #C0C0C0;
   color: #000000;
   cursor: pointer;
   cursor: hand; /* IE 5.5 non-compliant workaround */
}

More information at: http://raibledesigns.com/page/rd?anchor=making_your_tables_more_accessible

HTH,

Matt




------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ displaytag-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to