| FoxitPDFSDKforWeb v11.1.0 Archives Foxit PDF SDK for Web

Public Member Functions | List of all members
UIXModule Class Reference
UIExtension

A module constructed by `Modular.module` is collection of components and controllers. You can register a component class or a controller class into a module then you can use your component in template. An example for registering component class and usage: More...

## Public Member Functions
| controller (name, controllerDef)
| getPreConfiguredComponent (name)
| registerComponent (componentClass)
| registerController (ControllerClass)
| registerPreConfiguredComponent (name, component)

## Detailed Description

A module constructed by `Modular.module` is collection of components and controllers. You can register a component class or a controller class into a module then you can use your component in template. An example for registering component class and usage:

var myModule = UIExtension.modular.module('my-module', []);
var MyComponent = PDFViewCtrl.shared.createClass({
createDOMElement: function() {
return document.createElement('div');
}
}, UIExtension.Component,{
getName: function() {
return 'my-component'
}
});
myModule.registerComponent(MyComponent);
// Now, you can use your component in fragment like following:
new PDFUI({
// ...
fragments: [{
target: 'home-tab-group-hand',
action: UIExtension.UIConsts.FRAGMENT_ACTION.APPEND,
template: '<my-module:my-component></my-module:my-component>'
}]
})

Example for registering controller class and usage:

var myModule = UIExtension.modular.module('my-module', []); // pass [] as second parameter if `'my-module'` had not been created.
var MyController = PDFViewCtrl.shared.createClass({
handle: function() {
console.info('button click');
}
}, UIExtension.Controller, {
getName: function() {
return 'MyController'
}
});
myModule.registerController(MyController);
// Now MyController can be used in layout-template like following:
new PDFUI({
// ...
fragments: [{
target: 'home-tab-group-hand',
action: UIExtension.UIConsts.FRAGMENT_ACTION.APPEND,
template: '<xbutton @controller="my-module:MyController"></xbutton>' // @controller directive pattern: `<module-name>:<controller name returned from 'static getName()'>`
}]
})

See also
  Modular::module

## Member Function Documentation

## ◆ controller()

UIXModule::controller | ( |  | name,
|  |  | controllerDef
| ) |  |
| inline

Create and register a controller class!

Parameters

  name | string - name of the controller which will be used in layout-template
  controllerDef | object - Refer to Controller

Returns
  UIXModule - this ref

## ◆ getPreConfiguredComponent()

UIXModule::getPreConfiguredComponent | ( |  | name | ) |
| inline

Parameters

  name | string

Returns
  PreConfiguredComponent

## ◆ registerComponent()

UIXModule::registerComponent | ( |  | componentClass | ) |
| inline

Parameters

  componentClass | Component - UI Component

Returns
  UIXModule - this ref

## ◆ registerController()

UIXModule::registerController | ( |  | ControllerClass | ) |
| inline

Parameters

  ControllerClass | Controller - UI Component

Returns
  UIXModule - this ref

## ◆ registerPreConfiguredComponent()

UIXModule::registerPreConfiguredComponent | ( |  | name,
|  |  | component
| ) |  |
| inline

Parameters

  name | string
  component | PreConfiguredComponent

Returns
  UIXModule - this ref

@2026 Foxit Software Incorporated. All rights reserved.