using a javascript function to determine if a string is all digits or not and return result based off the decision. if it is all digits, mask all digits except the first two, if not all digits just return the string.
these are the snippets however i am not seeing anything returned in the column
Code:
<script >
var start = function RenderRC(CodeOwner) {
var Rcode = CodeOwner.toString();
var pattern = new RegExp("^\d{2,}$ ");
if (Rcode.match(pattern)) {
if (Rcode.length > 2)
{
var newcode = Rcode.substr(0, 2) + Array(Rcode.length - 2 + 1).join("*");
return newcode;
}
}
else
{
return Rcode;
}
};
</script>
<ext:RecordField Name="CodeOwner" />
<ext:Column Header="<%$ Resources:Text, CodeOwner %>"DataIndex="CodeOwner" Width="110" >
<Renderer Fn ="start" />
</ext:Column>