ClientType - property of the PmgRoot object
Description:
It gets whether the window is opened in the application or in the Web browser.
Values:
1 - The window is opened in the application.
2 - The window is opened in the Web browser.
Note:
Property access for
read only.
By this property it is possible to conditionally run different algorithms in the application and in the Web browser. It has sense only if the panel is used locally in the application and also for the Web as
Web panels (i.e. if the Web sharing is enabled on the "
Web server" tab).
This property is also functional in
Web panels.
If this property is used in the
PmgForm object (this script is also to be invoked in the development environment), then it is better to use the
PmForm.ClientType property.
Example:
JavaScriptVBScriptSelect and copy to clipboard
if (1 == pMe.Root.ClientType)
{
// algorithm for local panel
}
else if (2 == pMe.Root.ClientType)
{
// algorithm for the Web
}
If 1 = pMe.Root.ClientType Then
' algorithm for local panel
ElseIf 2 = pMe.Root.ClientType Then
' algorithm for the Web
End If