version 10.2 build 33576
On a master list page that has multiple detail tables, I would like to control the detail links like this:
Single icon for all details, no counts.
If no details for a particular details table, hide the details "tab" when you click the details icon.
If no details in any of the detail tables, hide the details icon.
I have not been able to achieve this with any combination of options ("designer page>List page properties>details link" or detail properties on the tables page) . The closest I got was setting the details options like this:
Show individual links per details table.
Hide if details empty.
This shows/hides the detail links in the grid, but if you click one of the detail links you still see all detail "tabs", even if they are empty.
I then tried doing my own code by adding this to the SQL query
case when Exists (select vd.VendorID
from dbo.VendorDetails vd
where vd.VendorID = dbo.Vendors.ID)
then 1
else 0
end as VendorDetails,
case when Exists (select c.Vendor
from dbo.Contacts c
where c.Vendor = dbo.Vendors.ID)
then 1
else 0
end as Contacts,
then adding this to List "page:After record processed":
if (!data["VendorDetails"]) {
pageObject.hideItem("details_VD");
}
if (!data["Contacts"]) {
pageObject.hideItem("details_Contacts");
}
if (!data["VendorDetails"] && !data["Contacts"]) {
pageObject.hideItem("grid_alldetails_link");
}
This seemed to evaluate the last statement as always true, so it hid the details icon on all records.
I then removed that part, which made the icon appear on all records, but all details "tabs" always showed.
I then added just the "pageObject.hideItem("details_Contacts");" with no condition but the details "tab" always showed.
Is it possible to achieve what I'm trying to do with some combination of option settings? If not, is there a way I can do it with code?
Hopefully this all makes sense. Let me know if not.
Thanks,
Tim