Skip to content

BuildFire Action Items Component

o5faruk edited this page May 2, 2021 · 8 revisions

⚠️⚠️⚠️

This sdk documentation is deprecated and will not be updated. Check out our new docs at https://sdk.buildfire.com/docs/action-items-component

⚠️⚠️⚠️

buildfire.components.actionItems

This component simplifies the development of the management controls when adding Action Items (see action items). Typically used on the Control side of a plugin, it allows the app owner to add, edit, delete and sort action items.

This name space consists of one major class:

  • sortableList which is the class that instantiates the editor component typically used on the control side to add, edit and delete action items

The sortableList

typically used on the control side to add, edit and delete action items.

Editor

Requirements

    <!-- Load helper.css to use our helper classes -->
    <link href="../../../../styles/helper.css" rel="stylesheet">
    <link href="../../../../styles/siteIcons.css" rel="stylesheet">


    <!-- JS -->
    <script src="../../../../scripts/buildfire.js"></script>
    <script src="../../../../scripts/sortable.min.js"></script>
    <script src="../../../../scripts/buildfire/components/actionItems/sortableList.js"></script>

Example

https://github.com/BuildFire/simpleBuildFireJSExamples/blob/master/exampleActionItems/control/content/index.html

Constructor

var editor = new buildfire.components.actionItems.sortableList([selector],[items optional]);

  • selector typical css selection string to identify the containing element
  • items loads any previously saved items. items are of type actionItem see Action Items

Methods

  • editor.init: a secondary method outside of the constructor to initialize the component
  • editor.loadItems(items, appendItems) use this method to load the carousel with new items or pass true in appendItems to append items to the existing list
  • editor.append: allows you to append a single item or multiple items at once. Items are of type actionItem see Action Items
  • editor.clear: use this method to clear out all your items form the carousel

Handlers

  • editor.onAddItems(items) an overridable handler that is called when an item is added
  • editor.onDeleteItem(item, itemIndex) an overridable handler that is called when an item is deleted
  • editor.onItemChange(item, itemIndex) an overridable handler that is called when an item is changed
  • editor.onOrderChange(item, oldIndex, newIndex) an overridable handler that is called when an item is changed

To see how to display action items on the widget side click here

Clone this wiki locally