This topic is locked

Control show/hide multiple detail tables

9/23/2019 2:52:55 PM
ASPRunner.NET General questions
T
Tim author

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

I
i.NoLim 9/24/2019





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'm not sure if this will resolve your issue, but the reason why it hid all the details icons is because the code doesn't specify which entry it should hide. You need something like this,

if (!data["VendorDetails"] && !data["Contacts"]) {

    pageObject.hideItem("grid_details_link", recordId);

[/b]}

T
Tim author 9/27/2019

Thank you! I always forget to add the "recordID" when I'm in a grid. This did resolve the issue with the details icon. I was hoping it would also fix the show/hide details "tabs" issue, but it did not.
Thanks,

Tim

T
Tim author 10/10/2019

Wow! In the latest build they quietly snuck in a "hideEmptyPreview" checkbox for detail tables on the list page. This is awesome! Total control now.
Best support of any product I have ever used!! Thank you!