Hi,
I have a RadPane that I need to resize depending on the situation. I found this pane method resize which can be set to resize forward or backward which is exactly what I need. However, it seems that it only works for forward everytime and not with backward orientation.
Here's the code I used for it:
function setPaneHeight(toExpand)
{
var pane = $find('<% pnlMainPanel.ClientID %>');
var isResized = document.getElementById('isMainPaneResized').value; //set to 1 or 0 if pane is resized already or not yet respectively
if (toExpand = "true")
{
if (isResized=="0") // not yet expanded or resized
{
pane.resize(25,2); //expand forward by 25 pixels
document.getElementById('isMainPaneResized').value = "1";
}
else //already expanded
{
//just do nothing
}
}
else // to contract pane
{
if (isResized == "0") //not yet expanded or resized
{
// just don't do anything
}
else
{
pane.resize (25,1); resize backwards by 25 pixels;
document.getElementById('isMainPaneResized').value = "0";
}
}
}
With this code above, I send a value of 1 (to expand) or 0 (to contract) and issue a pane resize correspondingly. And then I set the hidden field 'isMainPaneResized' so that I would know when to set it back to its original size. Basically when it is already expanded and I hit expand request again to this function, I would just not do anything. But if it is not yet expanded, I would then expand it and set the hidden value to expanded (1). And when it is already expanded (hidden value is already set to 1) and I send a "to contract" request, I would then "contract" it otherwise, I would just not do anything.
Please let me know if you have any further clarifications on this matter.
Thanks,
Arthur
I have a RadPane that I need to resize depending on the situation. I found this pane method resize which can be set to resize forward or backward which is exactly what I need. However, it seems that it only works for forward everytime and not with backward orientation.
Here's the code I used for it:
function setPaneHeight(toExpand)
{
var pane = $find('<% pnlMainPanel.ClientID %>');
var isResized = document.getElementById('isMainPaneResized').value; //set to 1 or 0 if pane is resized already or not yet respectively
if (toExpand = "true")
{
if (isResized=="0") // not yet expanded or resized
{
pane.resize(25,2); //expand forward by 25 pixels
document.getElementById('isMainPaneResized').value = "1";
}
else //already expanded
{
//just do nothing
}
}
else // to contract pane
{
if (isResized == "0") //not yet expanded or resized
{
// just don't do anything
}
else
{
pane.resize (25,1); resize backwards by 25 pixels;
document.getElementById('isMainPaneResized').value = "0";
}
}
}
With this code above, I send a value of 1 (to expand) or 0 (to contract) and issue a pane resize correspondingly. And then I set the hidden field 'isMainPaneResized' so that I would know when to set it back to its original size. Basically when it is already expanded and I hit expand request again to this function, I would just not do anything. But if it is not yet expanded, I would then expand it and set the hidden value to expanded (1). And when it is already expanded (hidden value is already set to 1) and I send a "to contract" request, I would then "contract" it otherwise, I would just not do anything.
Please let me know if you have any further clarifications on this matter.
Thanks,
Arthur