I am using dojo EnganceGrid which have 5 columns and the fifth column is image hyperlink. I want to replace hyperlink with text particular row of column. For example, I am clicking on 2nd row of fifth column. When I will click on image and My image hyperlink replace with some text. Can any one help to fix this issue?
For example
<th field="mobileNumber" noresize="true" formatter="formatMobileNumber" width="10" cellClasses="alignTextCenter">Mobile Number</th>
<span style="display:none" id="defaultFormatMobileNumber_${ns}">
<a href="javascript:void(0);" onClick="showMobileNumber(event,valueToChange)">
<img src='/images/mobile.png' />
</a>
</span>
function formatMobileNumber(data, rowId){
var link = dojo.byId('defaultFormatMobileNumber').innerHTML;
link = link.replace("valueToChange",rowId);
return link
}
function showMobileNumber_<p:namespace/>(e,rowIdx){
//here I want to replace my link with some text
}
The text that you want to show should be returned by the formatter. You could have
showMobileNumberset some variable, sayclickedRow, to the clicked row number and adaptformatMobileNumberto take that variable into account: