<apex:page standardController="Account" recordSetVar="accounts" sidebar="false">
<style>
.rowColor {
background-color:orange;
}
</style>
<script>
var pRow='';
function highlightElem(a) {
var c=a.className;
// alert(c);
a.className="rowColor";
if(pRow==''){
pRow=a;
}
else {
if(pRow.innerHTML!=a.innerHTML) {
pRow.className=c;
pRow=a;
}
}
}
</script>
<apex:form >
<apex:pageBlock >
<apex:PageBlockTable value="{!accounts}" var="r" onRowClick="highlightElem(this)" >
<apex:column value="{!r.Name}" />
<apex:column value="{!r.Phone}" />
<apex:column value="{!r.Type}" />
</apex:PageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
<style>
.rowColor {
background-color:orange;
}
</style>
<script>
var pRow='';
function highlightElem(a) {
var c=a.className;
// alert(c);
a.className="rowColor";
if(pRow==''){
pRow=a;
}
else {
if(pRow.innerHTML!=a.innerHTML) {
pRow.className=c;
pRow=a;
}
}
}
</script>
<apex:form >
<apex:pageBlock >
<apex:PageBlockTable value="{!accounts}" var="r" onRowClick="highlightElem(this)" >
<apex:column value="{!r.Name}" />
<apex:column value="{!r.Phone}" />
<apex:column value="{!r.Type}" />
</apex:PageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
No comments:
Post a Comment