/smartsheet-picker-angularjs

A Smartsheet Picker directive for AngularJS

Primary LanguageCSSApache License 2.0Apache-2.0

Smartsheet Picker AngularJS

An AngularJS directive that provides an expandable tree-view of a Smartsheet user's sheets, reports, workspaces and sights.

Smartsheet Picker Folder Tree

The directive consumes the response from a GET /home call from the Smartsheet API and organizes it into a tree structure that is also searchable.

Install

To install drop the smartsheetPicker directory into your project and be sure to include the following files in your html:

smartsheetPicker/

  • dist/smartsheetPicker.module.js
  • dist/smartsheetPicker.directive.js
  • dist/smartsheetPicker.css

Usage

        <smartsheet-picker
            on-sheet-select="vm.setSelectedSheet(selectedSheet)"
            tree-data="vm.treeData"
            selected-sheet= "vm.selectedSheet"
            include-sheets="true"
            include-reports="true"
            include-sights="false"></smartsheet-picker>

The directive provides several options for customization. Here's an explanation of each of the available parameters:

  • on-sheet-select: this is the callback function that will be called when an item in the picker is selected
  • tree-data: the json response from calling GET /home from the Smartsheet API
  • selected-sheet: value of the selected sheet
  • include-sheets: boolean value of whether sheets will be included in the picker
  • include-reports: boolean value of whether reports will be included in the picker
  • include-sights: boolean value of whether sights will be included in the picker

Compatibility

This was built and tested with AngularJS v. 1.6.5 and Bootstrap 3.3.7