Class XmlLoader
Constructors
constructor
-
Create a new xml loader
Parameters
- parentClass: any = null
Sets the class context. Used when the loader is instanced inside a class and not in a global context
Returns XmlLoader
- parentClass: any = null
Methods
dispose
-
Disposes the loaded layout
Returns void
get Node By Id
-
Gets a loaded node / control by id.
Parameters
- id: string
the Controls id set in the xml
Returns any
element of type Control
- id: string
get Nodes
-
Gets all loaded nodes / controls
Returns any
Array of controls
is Loaded
-
Gets if the loading has finished.
Returns boolean
whether the loading has finished or not
load Layout
-
loadLayout(
xmlFile: any,
rootNode: any,
onSuccess?: Nullable<() => void>,
onError?: Nullable<(error: string) => void>,
): voidInitiates the xml layout loading
Parameters
- xmlFile: any
defines the xml layout to load
- rootNode: any
defines the node / control to use as a parent for the loaded layout controls.
- onSuccess: Nullable<() => void> = null
defines the callback called on layout load successfully.
- onError: Nullable<(error: string) => void> = null
defines the callback called on layout load failure.
Returns void
- xmlFile: any
load Layout Async
-
Initiates the xml layout loading asynchronously
Parameters
- xmlFile: any
defines the xml layout to load
- rootNode: any
defines the node / control to use as a parent for the loaded layout controls.
Returns Promise<any>
Promise
- xmlFile: any
Class used to load GUI via XML.