Hi,
In my project I've included WebSplitter that contains 2 panes splited verticaly. In the right Pane I have WebDataGrid which displays results from the parameters inserted into the Search Control in the left pane. I wanted the left pane to be colapsable so I can get more space to display the results in the WebDataGrid. The width of the DataGrid and the Right Pane is set to 100%.
When I colapse the left pane the DataGrid and the right pane resize normaly. But when i reopen the left pane the DataGrid and the right pane don't resize and extend the whole page with the width of the left reopened pane.
NOTE: This problem exists FireFox, in IE they resize back normaly
Thank you for a sample, I reproduced that in Firefox. All other browsers: IE, Safari, Chrome, Opera work fine.
The logic of splitter is based on assumption that size of its outer <div> (which has overflow:hidden) matches with actual size of control. All calculations of pane layout are based on that assumption. I tested behavior of <table> in Firefox and found that is rather strange. The size of its <td> increases if content of its child is modified/increased by javascript. Even that content is located in <div> with hidden overflow, but Firefox seems to ignore that attribute and increases overall width of table.To me it looks like a bug in Firefox.
Attempts to get around that specific issue of Firefox in logic of splitter worked in a specific sample, but failed for a general case.I advise to remove splitter from table. If that is not possible for application, then the best I can do, is to suggest following work around:
1. Process before and after expand events.2. Within before expand event, check if width is % and it is Firefox and replace % width by px.3. Within after expand event, check if width was modified and restore old width.
Below is implementation<script type="text/javascript">function expandedEvt(splitter, evtArgs){ var width = splitter._widthToRestore; if(width) splitter.get_element().style.width = width;}function expandingEvt(splitter, evtArgs){ var elem = splitter.get_element(); var width = elem.style.width, oW = elem.offsetWidth; if(width.indexOf('%') < 0 || oW < 10 || !$util.IsFireFox) return; elem.style.width = (oW - 4) + 'px'; splitter._widthToRestore = width;}</script>
<ig:WebSplitter ID="WebSplitter1" runat="server" Height="200px" Width="100%"> ... <ClientEvents Expanded="expandedEvt" Expanding="expandingEvt" /></ig:WebSplitter>
The problem occures when the WebSpliter is inside table. Please try this :
<table class="style1"> <tr> <td> <ig:WebSplitter ID="WebSplitter1" runat="server" Height="200px" Width="100%"> <panes> <ig:SplitterPane runat="server" CollapsedDirection="PreviousPane" MinSize="150px"> </ig:SplitterPane> <ig:SplitterPane runat="server"> </ig:SplitterPane> </panes> </ig:WebSplitter> </td> </tr> </table>
I tested following and it worked in IE and Firefox same way. After expand left page, the width of WebSplitter did not increase (grid was filled with data within OnLoad).
<ig:WebSplitter ID="WebSplitter1" runat="server" Height="166px" Width="100%"> <Panes> <ig:SplitterPane runat="server" CollapsedDirection="NextPane"></ig:SplitterPane> <ig:SplitterPane runat="server" Size="100%"> <Template> <ig:WebDataGrid style="" ID="WebDataGrid1" runat="server" Height="370px" Width="100%"> </ig:WebDataGrid> </Template> </ig:SplitterPane> </Panes></ig:WebSplitter>