nodestable.view
NodesTableView : d2/sdk/widgets/nodestable/nodestable.view
Base class for all table-like widgets. Typically a subclass of this type is used whenever an ApplicationScopePerspective requires a table-like rendering.
Extends: Marionette.CollectionView
Example (A minimum sample derivative may look like)
//In mybundle/widgets/sample.table/sample.table.view.js
define([
'd2/sdk/widgets/nodestable/nodestable.view',
'mybundle/utils/contexts/factories/sample.table.collection.factory'
], function(NodesTableView, SampleTableCollectionFactory){
'use strict';
var SampleTableView = NodesTableView.extend({
constructor: function SampleTableView(options) {
options = options || {};
options.className = 'my-table-view';
options.d2collectionFactory = SampleTableCollectionFactory;
SampleTableView.__super__.constructor.call(this, options);
}
});
return SampleTableView;
});
Example (To link it to a perspective)
//In mybundle/utils/perspectives/table.perspecitve.json
{
"type": "left-center-right",
"options": {
"center": {
"type": "mybundle/widgets/sample.table"
}
}
}
//In mybundle/extensions/perspectives.js
define([], function(){
'use strict';
return [{
...,
perspectiveJson: 'mybundle/utils/perspectives/table.perspecitve.json',
...
}];
});
Example (Finally, to register the perspective definition as an application scope perspective)
//In extensions.json
{
"d2/sdk/utils/perspectives/app.scope.perspectives": {
"extensions": {
"mybundle": {
"mybundle/extensions/perspectives"
}
}
}
}
- NodesTableView :
d2/sdk/widgets/nodestable/nodestable.view- instance
- .getZeroRecordText() ⇒
string - .getTitle() ⇒
string - .getContainerNode() ⇒
NodeModel - .getExtraIconConfig() ⇒
object - .getCollectionOptions() ⇒
object
- .getZeroRecordText() ⇒
- static
- .extend(protoProperties, staticProperties) ⇒
function
- .extend(protoProperties, staticProperties) ⇒
- inner
- instance
nodesTableView.getZeroRecordText() ⇒ string
Hizibizi
Kind: instance method of NodesTableView
Returns: string - Text to be shown when there are no items in the data holder collection.
nodesTableView.getTitle() ⇒ string
Kind: instance method of NodesTableView
Returns: string - Title to show at header of this table
nodesTableView.getContainerNode() ⇒ NodeModel
Kind: instance method of NodesTableView
Returns: NodeModel - A node model to hold represenation data for the table header.
nodesTableView.getExtraIconConfig() ⇒ object
Kind: instance method of NodesTableView
Returns: object - Additional attributes to be merged with the NodeModel returned from getContainerNode().
nodesTableView.getCollectionOptions() ⇒ object
Kind: instance method of NodesTableView
Returns: object - Additional option to be used while constructing the collection from collectionClass constructor option.
NodesTableView.extend(protoProperties, staticProperties) ⇒ function
To define a derived type from NodesTableView.
Kind: static method of NodesTableView
Returns: function - The derived type.
| Param | Type | Description |
|---|---|---|
| protoProperties | object | Properties attached to the prototype of derived type. |
| protoProperties.constructor | function | The function to be used to construct instance of the derived type. |
| staticProperties | object | Properties statically attached to the derived type. |
NodesTableView~NodesTableView
Kind: inner class of NodesTableView
new NodesTableView([options])
| Param | Type | Description |
|---|---|---|
| [options] | object | Constructor options |
| [options.cssClass] | string | CSS class name to be added to HTML element representing this whole table view. |
| [options.d2collectionFactory] | Factory | Collection factory to be used to instantiate the collection that will hold data for this table. |
| [options.collectionClass] | function | A constructor type to be used to instantiate the data holder collection. |
| [options.collection] | Backbone.Collection | A collection instance to be used as data holder for the table. One of |
| [options.toolbarItems] | NodesTableToolbar | Menu configuration for the table view. |
NodesTableView~NodesTableToolbar : Object
Toolbar type for NodesTable.
Kind: inner typedef of NodesTableView
Properties
| Name | Type | Description |
|---|---|---|
| inlineActionbar | ToolitemsFactory | Menu configuration used at inidividual item level. |
| tableHeaderToolbar | ToolitemsFactory | Menu configuration for the header. |