~~Title: DropBox Integration~~

<html><font color=#990000 size="+2"><b>DropBox Integration</b></font></html>

<color #00a2e8>Knowledge Works™</color> fabric applications fully support the //DropBox// infrastructure providing an extensive set of //Components// and //Controls// that allow users to fully control dropbox behavior, look and fele as well as ability to take action on content changes.  At this time //Push Notification// for //DropBox// are not supported.  However user can create //Live Components// that auto refresh //Components// or //Controls// allowing you to perform application actions when data changes.




==== DropBox Components ====

DropBox, DropBox Administrator

==== DropBox Controls ====

DropBox Explorer, DropBox Administrator


==== DropBox Control API ====

The following methods

  * ''canDownload(entry )''
  * ''download(entry)''
  * ''canOpen(entry)''
  * ''open(entry)''
  * '' canUpload()''
  * ''upload()''
  * ''canDelete(entry)''
  * ''delete(entry)''
  * ''reload()''
  * ''entries'' - An array with raw data from dropbox
  * 


==== DropBox Context Menu ====

DropBox Explorer, DropBox Administrator



==== Triggers and Events ====


- CM look&feel support

The Context menu now also has //trigger// option that is invoked when //Context Menu// is shown.

{{:wiki:rtai:context_menu_ctrl.png|}}

- context menu on grid - selection on right click if single select mode
- context menu on grid/dropbox - menu item trigger receives extra data in 'options' targetControl and targetElement so you can check which row/cell was right clicked.


- menuItems - triggerContextMenu option added, invoked each time before showing context menu. (useful for dynamic hiding/disabling menu items)
usage example:


- control.triggers.[visible/disabled/readOnly] added - if added they will be triggered on corresponding control property change.
- control addTrigger addOneTimeTrigger removeTrigger raiseEvent API added similar to ones on component level.

For example:
  
<sxh DSQL; gutter: true;>  

  ctrl.addTrigger('visible', function(event,value,old){ console.log(event+' changed to '+value);});
</sxh>  
  

- dropbox control now has default context menu with reload/open/download/upload/delete menu items. All items are fully customizable.

{{:wiki:dropbox:dropbox_menu.png|}}


==== General Notes TBD ====

•	How Do I remove the Up Arrow Navigation Row from dropbox 
so I don’t allow users to navigate up to higher levels of a folder?
 
•	how do I enable pop-up panel (callout) for icons.. since we use that 
as the control.. I want to use the capability
 
•	how do I change icon of file? or folder?
 
•	how do I write a trigger for row selection?
 
•	how do I write trigger for checkbox selection?
 
•	rowStyle in Dropbox Control doesn’t seem to work
but work on Tree area in DropBox Component



•	Set dropBox.navigateFolder to 'off' - it will disable navigation and up arrow button, so only initial folder will be accessible via UI
•	We have separate 'callout' control for this. On regular icon the best you can do is to add contextMenu.
•	You can override dropBox icons in dropBox.dropBoxIcons
•	In dropBox the best trigger will be "change":

<sxh DSQL; gutter: true;>

  function(event, control, component, anchor, data) {   
    console.log('Row clicked:', anchor);  // exact row being clicked, check anchor.entry for extra useful info
    console.log('Current selection: ',control.getSelectedRows()); // grid rows in current selection, may be multiple
  }
</sxh>

'rowSelect' trigger is specific to base Grid(and still follows old signature) but also you can use it.
•	by checkbox you mean inside checkbox column? then dropBox/columns/checkbox/control/triggers/isChecked:

<sxh DSQL; gutter: true;>

  function(event, control, component, anchor, data) { 
    console.log(event+' at '+control.nicePath, data, control.gridElement.record);
  }
</sxh>

- CM
