Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=4859979
By: sahaya20
Hi,
Please try the following script code.
<td>
<display:table name="XYZ" id="custTable" pagesize="20" style="width:100%;">
<display:column property="col1" sortable="true"/>
<display:column property="col2"/>
</display:table>
<script type="text/javascript">highlightTableRows("custTable");</script>
</td>
then you can add the following script code in your JS file.
function highlightTableRows(tableId) {
var previousClass = null;
var table = document.getElementById(tableId);
var tbody = table.getElementsByTagName("tbody")[0];
var status;
if (tbody == null) {
var rows = table.getElementsByTagName("tr");
} else {
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 cell1 = this.getElementsByTagName("td")[1];
var col1Value = cell.innerHTML;
var col2Value = cell1.innerHTML;
<< here u can place this value to your fields for
ex:>>
document.forms[0].field1.value= col1Value;
document.forms[0].field1.value= col2Value;
}
}
}
Cheers,
Sahaya ANTONI
______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=249318
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user