Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Custom Builder Javascript Object

Utility methods and fields to use in the builder javascript. 

Methods
CustomBuilder.callback(name, args)

To call a method by name

Parameters

    • name - a method name.
    • args - arguments to pass to the method call
CustomBuilder.initConfig(config)

To initialize the builder configuration by the platform

Parameters

    • config - the configuration object.
CustomBuilder.initPropertiesOptions(options)

To initialize the builder properties tab  by the platform

Parameters

    • options - the builder properties options
CustomBuilder.initBuilder(callback)

To initialize the builder by the platform

Parameters

    • callback - the callback method to call after builder initialized.
CustomBuilder.showPopUpBuilderProperties()

To show the builder properties in a popup editor.

CustomBuilder.saveBuilderProperties(container, properties)

To save the builder properties

Parameters

    • container - the property editor container
    • properties - the properties to save
CustomBuilder.initPaletteElement(category, className, label, icon, propertyOptions, defaultPropertiesValues, render, css, metaData)

To populate elements(plugins) in the side palette.

Parameters

    • category - the category of the elements(plugins)
    • className - the classname of the elements(plugins)
    • label - the label of the elements(plugins)
    • icon - the label of the elements(plugins)
    • propertyOptions - the plugin properties options the edit the element(plugin)
    • defaultPropertiesValues - the default properties values to set to a new element object added to canvas.
    • render - set to false to not render the elements(plugins) in side palette
    • css - the css class to palette element
    • metaData - the additional data of the elements(plugins) to used by the builder 
CustomBuilder.loadJson(json)

To load a json to the builder

Parameters

    • json - the JSON definition to load
CustomBuilder.update(addToUndo)

Update the CustomBuilder.json based on the data stored in CustomBuilder.data

Parameters

    • addToUndo - true to add the previous stored JSON definition to undo stack.
CustomBuilder.updateJson(json, addToUndo)

Update CustomBuilder.json to the pass in JSON.

Parameters

    • json - the JSON definition to update to CustomBuilder.json.
    • addToUndo - true to add the previous stored JSON definition to undo stack.
CustomBuilder.getJson()

Get the value in CustomBuilder.json.

CustomBuilder.save()

To save the builder JSON definition.



Sample Plugins