There is a developer blog article that explains how to modify some core files so that subpanels are collapsed in the detailview when there is no data to display.
It's great to be able to add this feature - especially for modules that have an extensive number of subpanels. However, we noticed that if a user collapses a subpanel, when a module is loaded that DOES have data in that subpanel, the subpanel stays collapsed.
Obviously, this could potentially be problematic, as it would be easy for a user to assume that if a subpanel is collapsed, then there is no information there, when in fact there is.
We're wondering what code would need to be added to force expanding subpanels that do have data. Presumably it would be a matter of adding an else clause in the ListView.php code.
I've added the code from the blog below for your convenience.
For anyone that hasn't read the blog and wishes to implement this, THIS IS NOT AN UPGRADE-SAFE SOLUTION!!
In the Include/ListView/ListView.php file:
And in the include/SubPanel/SubPanelDynamic.html file:PHP Code:if ( empty($data) ) {
$this->xTemplate->assign("ROW_COLOR", 'oddListRow');
$thepanel=$subpanel_def;
if($subpanel_def->isCollection())
$thepanel=$subpanel_def->get_header_panel_def();
$this->xTemplate->assign("COL_COUNT", count($thepanel->get_list_fields()));
// BEGIN CUSTOMIZATION
$this->xTemplate->assign("PANEL_NAME", $thepanel->get_name());
// END CUSTOMIZATION
$this->xTemplate->parse($xtemplateSection.".nodata");
}
Thanks for anyone's help/suggestions!HTML Code:<!-- BEGIN: nodata --> <tr height='20' class='{ROW_COLOR}S1'> <td colspan='{COL_COUNT}'> <em>{APP.LBL_NO_DATA}</em> <!-- BEGIN CUSTOMIZATION --> <script type="text/javascript"> document.getElementById('subpanel_{PANEL_NAME}').style.display = 'none'; document.getElementById('hide_link_{PANEL_NAME}').style.display = 'none'; document.getElementById('show_link_{PANEL_NAME}').style.display = ''; </script> <!-- END CUSTOMIZATION --> </td> </tr> <!-- END: nodata -->


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks