some basic documentation for the asset manager javascript
This commit is contained in:
parent
84764dfe5d
commit
b6118740f9
1 changed files with 81 additions and 0 deletions
81
www/extras/assetManager/assetManager.txt
Normal file
81
www/extras/assetManager/assetManager.txt
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
some basic documentation:
|
||||
|
||||
|
||||
*****************Configuring the asset manager.*****************
|
||||
|
||||
//to create a new asset manager
|
||||
var manager = new AssetManager(assets,columnHeadings,labels,crumbtrail); manager.renderAssets();
|
||||
|
||||
//available properties. Properties should be set prior to the render asset call.
|
||||
|
||||
*********************************************************
|
||||
assetType - defaults to "Asset"
|
||||
|
||||
The following example starts the asset manager with a different asset type.
|
||||
|
||||
var manager = new AssetManager(assets,columnHeadings,labels,crumbtrail); manager.assetType="MyNewAsset"
|
||||
manager.renderAssets();
|
||||
|
||||
*********************************************************
|
||||
sortEnabled = true - enables or disables sorting of the grid. Defaults to true
|
||||
|
||||
The following example starts the asset manager with sorting disabled.
|
||||
|
||||
var manager = new AssetManager(assets,columnHeadings,labels,crumbtrail); manager.sortEnabled=false;
|
||||
manager.renderAssets();
|
||||
|
||||
*********************************************************
|
||||
displayCrumbTrail = Enables or disables display of the crumbtrail. Defaults to true
|
||||
|
||||
The following example starts the asset manager with the crumb trail disabled
|
||||
.
|
||||
var manager = new AssetManager(assets,columnHeadings,labels,crumbtrail); manager.displayCrumbTrail=false;
|
||||
manager.renderAssets();
|
||||
|
||||
**********************************************************
|
||||
To disable display item in the grid, the disableDisplay function can be called on the asset manager. The function takes the index of the item to disable from the columnHeadings array.
|
||||
|
||||
The following example disables the rank and title
|
||||
|
||||
var manager = new AssetManager(assets,columnHeadings,labels,crumbtrail); manager.disableDisplay(0);
|
||||
manager.disableDisplay(1);
|
||||
manager.renderAssets();
|
||||
|
||||
*********************Configuring Assets**********************
|
||||
|
||||
To create a new asset, the Asset object must be extended. The following example creates an asset with the same properties and methods as the Asset object.
|
||||
|
||||
function MyNewAsset() {
|
||||
var asset = new Asset(); return asset;
|
||||
} To change the new asset object, properties and methods can be added or overriden
|
||||
|
||||
The following example overrides the getContextMenu method, adds a new retore method, and sets the dragEnabled property to false
|
||||
|
||||
function MyNewAsset) {
|
||||
var asset = new Asset();
|
||||
asset.dragEnabled = false;
|
||||
|
||||
asset.getContextMenu = function () {
|
||||
var arr = new Array(); arr[arr.length] = new ContextMenuItem(this.labels["cut"],"javascript:" + this.evalReference() + ".cut()");
|
||||
arr[arr.length] = new ContextMenuItem("<img src='/extras/assetManager/breakerLine.gif'>","");
|
||||
arr[arr.length] = new ContextMenuItem(this.labels["purge"],"javascript:" + this.evalReference() + ".purge()");
|
||||
return arr; }
|
||||
asset.restore = function() {
|
||||
location.href = this.parent.getWrappedURL() + "func=postList" + AssetManager_getManager().getSelectedAssetIds(); }
|
||||
|
||||
return asset;
|
||||
|
||||
} /*************availble asset properties *********************
|
||||
|
||||
dragEnabled - Enables or disables making the asset dragable. Defaults to true
|
||||
allowMultiSelect - Enables or disables multiselection of the asset. Defaults to true;
|
||||
|
||||
|
||||
***************Notes*********************
|
||||
|
||||
1. The asset class contains a getWrappedURL() method that return the asset.url property wrapped in "http://hostname" and the paramenter delimiter
|
||||
2. asset.parent will return the parent asset (on the crumbtrail)
|
||||
3. The AssetManager_getManager().getSelectedAssetsIds() method will return a parameter string containing all the selected asset Id's
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue