Thanks Arpit. But in my actual scenario, the entity has 13 optionset values. I already have separate entity list & web pages for each of the type which are exposed as links on the portal. So for example, there are links such as "Case - Questions", "Case - Problem" & "Case - Request".
Now the requirement is to have a common list where they can see all the records and then click on view details which opens the respective web page.
The fields/ customization for each is very different so it would be more time consuming to write a script to show/ hide values. Also, each type has their own functionality. Because of these I was avoiding having a common page and use JS to show/ hide.
I was able to achieve this requirement by the below JS but not sure if this is the best way to acheive it.
================
$(document).ready(function (){
$(".entitylist.entity-grid").on("loaded", function () {
$(this).children(".view-grid").find("tr").each(function (){
var caseTypeCode;
$(this).find("td").each(function (){
var elm = $(this).attr("data-attribute");
if(elm === "casetypecode")
{
caseTypeCode = $(this).text();
}
});
// Find the path
var currentPath;
$(this).find("td").each(function (){
$(this).find("a").each(function (){
var currentPath = $(this).attr('href');
if(caseTypeCode === "Problem")
{
currentPath = currentPath.replace("edit-case", "edit-case-problem");
$(this).attr('href',currentPath);
}
else if(caseTypeCode === "Question")
{
currentPath = currentPath.replace("edit-case", "edit-case-question");
$(this).attr('href',currentPath);
}
else if(caseTypeCode === "Request")
{
currentPath = currentPath.replace("edit-case", "edit-case-request");
$(this).attr('href',currentPath);
}
$(this).prop('target', '_blank');
});
});
});
});
});
================