viewHandlers defines views (i.e. the view shown in the middle of main window, e.g. tracklist, albumlist, etc.)
Particular view handler for a node is defined by nodeHandler, e.g. nodeHandlers.genre.viewAs: ['genreView', 'albumlist', 'tracklist'] means that we can swith between 'genreView', 'albumlist' and 'tracklist' to view the genre content
Example (see /sampleScripts/customNodes/viewHandlers_add.js for more examples, or the individual handlers below):
viewHandlers.tracklist = inheritHandler('Tracklist', 'Base', { controlClass:'ColumnTrackList', // means that 'ColumnTrackList' control will be used as UI element (defined in /controls/columntracklist.js) // the following are optional: title:'Show Trackgrid', // title to show on view type switch toolbar icon:'listview', // icon to show on view type switch toolbar toolbarActions: [actions.includeSubfolders], // custom actions to add on toolbar, actions have to contain identifier property with action id onShow:function (control, view) {}, // code to perform when the view is shown onHide:function (control, view) {}, // code to perform when the view is hidden defaultFocusControl:function (control) { returncontrol;} // optional, used e.g. when Ctrl+A is pressed or 'Scroll to matches' performed });
'tracklist' is defined by viewHandlers.tracklist below (aka viewHandlers['tracklist'] ):
viewHandlers defines views (i.e. the view shown in the middle of main window, e.g. tracklist, albumlist, etc.) Particular view handler for a node is defined by nodeHandler, e.g.
nodeHandlers.genre.viewAs: ['genreView', 'albumlist', 'tracklist']
means that we can swith between'genreView'
,'albumlist'
and'tracklist'
to view the genre contentExample (see
/sampleScripts/customNodes/viewHandlers_add.js
for more examples, or the individual handlers below):'tracklist'
is defined byviewHandlers.tracklist
below (akaviewHandlers['tracklist']
):**