This property of the Smartframe Newlook Control returns a structure containing the recommended Width and Height of the control to prevent scrollbars from displaying. Read-only at runtime.
param name="DesiredClientSize" value=[structure]
Where structure contains the recommended client width and height as key/value pairs.
Introduced in Version 11.1.0.
This property (and related OnDesiredClientSizeChanged Event) are useful for solutions that use fixed scaling - to provide a mechanism for preventing the display of horizontal and vertical scrollbars in the Smartframe Newlook Control at runtime.
This DesiredClientSize property returns a structure containing a width and height property. These properties represent the size that the client should be rendered at, in order to avoid scrollbars. To prevent scrollbars, the Smartframe developer can add an event handler for the OnDesiredClientSizeChanged event to their Smartframe template, to query the control for its current size, relative to the DesiredClientSize, and adjust the Smartframe Newlook Control size if necessary.
It is recommended that you apply a tolerance when handling the OnDesiredClientSizeChanged event to avoid introducing a feedback loop. Refer to the example below.
// The following function (triggered by the OnDesiredClientSizeChanged event) compares the current height and width of the Smartframe Newlook Control to the height and width values returned by the DesiredClientSize property, and adjusts the control's height and width if there is a difference greater than the specified 5 pixel tolerance.
newlook1.OnDesiredClientSizeChanged = function (desiredClientSize) {
if (Math.abs($(newlook1).width() - desiredClientSize.Width) > 5
|| Math.abs($(newlook1).height() - desiredClientSize.Height) > 5) {
$(newlook1).width(desiredClientSize.Width);
$(newlook1).height(desiredClientSize.Height);
}
}
OnDesiredClientSizeChanged
Event | Customizing Smartframe templates | Smartframe Newlook Control API
© 2004-2021 looksoftware. All rights reserved.