Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

Const Class

Class: Class

An object that can be used to emulate classes and a class hierarchy in JavaScript. This works even for old browsers that do no support the native class syntax yet. Note however, that this should be mostly compatible with the new class syntax of JavaScript, so consider creating your own widgets as a class:

class MyWidget extends PrimeFaces.widget.BaseWidget {
  init(cfg){
    // ...
  }
}

Note to typescript users: You will need to specify the type parameters explicitly. The best way to do so is by defining the interfaces for the classes separately:

interface BaseWidgetCfg {
 prop1: string;
}
interface AccordionPanelCfg extends BaseWidgetCfg {
  prop2: boolean;
}
interface BaseWidget {
  init(cfg: BaseWidgetCfg): void;
  method1(x: number): boolean;
}
interface Accordion extends BaseWidget {
  init(cfg: AccordionPanelCfg): void;
  method1(): boolean;
  method2(): boolean;
}

Now you can use it normally:

const BaseWidget = Class.extend<BaseWidget, [BaseWidgetCfg]>({
  init(cfg: BaseWidgetCfg) {
    // ...
  },
  method1(x: number): boolean {
    return x > 0;
  },
});
const Accordion = BaseWidget.extend<Accordion, [AccordionCfg]>({
  init(cfg: AccordionCfg) {
    this._super(cfg);
  },
  method1() {
    return !this._super(42);
  },
  method2() {
    return true;
  }
});
const base: BaseWidget = new BaseWidget({prop1: ""});
const accordion: Accordion = new Accordion({prop1: "", prop2: true});
base.method1(2);
accordion.method1();
accordion.method2();

Date

Date: DateConstructor

Event

Event: { AT_TARGET: number; BUBBLING_PHASE: number; CAPTURING_PHASE: number; NONE: number; prototype: Event }

Type declaration

  • Readonly AT_TARGET: number
  • Readonly BUBBLING_PHASE: number
  • Readonly CAPTURING_PHASE: number
  • Readonly NONE: number
  • prototype: Event

HTMLElement

HTMLElement: { prototype: HTMLElement }

Type declaration

Math

Math: Math

An intrinsic object that provides basic mathematics functionality and constants.

Const Quill

The globally available constructor for the Quill text editor used by the TextEditor widget.

Window

Window: { prototype: Window }

Type declaration

Const jQBrowser

jQBrowser: BrowserInspector

Contains information about the current browser environment, such as which browser the user is using etc.

Functions

PF

  • Finds and returns a widget

    Note to typescript users: You should define a method that takes a widget variables and widget constructor, and check whether the widget is of the given type. If so, you can return the widget and cast it to the desired type:

    function getWidget<T extends PrimeFaces.widget.BaseWidget>(widgetVar, widgetClass: new() => T): T | undefined {
      const widget = PrimeFaces.widget[widgetVar];
      return widget !== undefined && widget instanceof constructor ? widgetClass : undefined;
    }
    

    Parameters

    • widgetVar: string

      The widget variable of a widget.

    Returns BaseWidget | undefined

    The widget instance, or undefined if no such widget exists currently.

autosize

  • autosize<TElement>(element: TElement): TElement
  • Autosize is a small, stand-alone script to automatically adjust textarea height to fit text. Attaches autosize to the given element or elements.

    See http://www.jacklmoore.com/autosize

    Type parameters

    Parameters

    • element: TElement

      The TEXTAREA element to which to attach autosize.

    Returns TElement

Generated using TypeDoc