Roo.util.Observable Roo.View
Package: | Roo |
Defined In: | Roo/View.js. |
Class: | View |
Subclasses: | Roo.JsonView |
Extends: | Roo.util.Observable |
var store = new Roo.data.Store(...);
var view = new Roo.View({
el : "my-element",
tpl : '<div id="{0}">{2} - {1}</div>', // auto create template
singleSelect: true,
selectedClass: "ydataview-selected",
store: store
});
// listen for node click?
view.on("click", function(vw, index, node, e){
alert('Node "' + node.id + '" at index: ' + index + " was clicked.");
});
// load XML data
dataModel.load("foobar.xml");
Options | Defined By | |
---|---|---|
dataName : String
the named area of the template to use as the data area
Works with domtemplates roo-name="name" the named area of the template to use as the data area
Works with domtemplates roo-name="name" |
Roo.View | |
el : String|Roo.Element
The container element.
The container element.
|
Roo.View | |
emptyText : String
The empty text to show when nothing is loaded.
The empty text to show when nothing is loaded.
|
Roo.View | |
listeners : Object
list of events and functions to call for this object,
For example :
list of events and functions to call for this object,
For example :
|
Roo.util.Observable | |
multiSelect : Boolean
Allow multiple selection
Allow multiple selection
|
Roo.View | |
selectedClass : String
The css class to add to selected nodes
The css class to add to selected nodes
|
Roo.View | |
singleSelect : Boolean
Allow single selection
Allow single selection
|
Roo.View | |
store : Roo.data.Store
Data store to load data from.
Data store to load data from.
|
Roo.View | |
text : String
to display on mask (default Loading)
to display on mask (default Loading)
|
Roo.View | |
toggleSelect : Boolean
- selecting
- selecting
|
Roo.View | |
tpl : String|Roo.Template
The template used by this View
The template used by this View
|
Roo.View |
Method | Defined By | |
---|---|---|
new Roo.View
(Object config)
Create a new Roo.View
Create a new Roo.View
|
||
addEvents
(Object object)
Used to define events on this Observable
Used to define events on this Observable
|
Roo.util.Observable | |
Appends an event handler to this component
Appends an event handler to this component
|
Roo.util.Observable | |
clearSelections
(Boolean suppressEvent)
Clear all selections
Clear all selections
|
Roo.View | |
findItemFromChild
(HTMLElement node)
:
HTMLElement
Returns the template node the passed child belongs to or null if it doesn't belong to one.
Returns the template node the passed child belongs to or null if it doesn't belong to one.
|
Roo.View | |
Fires the specified event with the passed parameters (minus the event name).
|
Roo.util.Observable | |
getEl
()
:
Roo.Element
Returns the element this view is bound to.
Returns the element this view is bound to.
|
Roo.View | |
getNode
(HTMLElement/String/Number nodeInfo)
:
HTMLElement
Gets a template node.
Gets a template node.
|
Roo.View | |
Roo.View | ||
getSelectedIndexes
()
:
Array
Get the indexes of the selected nodes.
Get the indexes of the selected nodes.
|
Roo.View | |
getSelectedNodes
()
:
Array
Get the currently selected nodes.
Get the currently selected nodes.
|
Roo.View | |
getSelectionCount
()
:
Number
Get the number of selected nodes.
Get the number of selected nodes.
|
Roo.View | |
Roo.util.Observable | ||
indexOf
(HTMLElement/String/Number nodeInfo)
:
Number
Finds the index of the passed node
Finds the index of the passed node
|
Roo.View | |
isSelected
(HTMLElement/Number node)
:
Boolean
Returns true if the passed node is selected
Returns true if the passed node is selected
|
Roo.View | |
Appends an event handler to this element (shorthand for addListener)
Appends an event handler to this element (shorthand for addListener)
|
Roo.util.Observable | |
onBeforeLoad
()
onbeforeLoad - masks the loading area.
onbeforeLoad - masks the loading area.
|
Roo.View | |
prepareData
(Array/Object data)
Function to override to reformat the data that is sent to
the template for each node.
Function to override to reformat the data that is sent to
the template for each node. DEPRICATED - use the preparedata event handler.
|
Roo.View | |
purgeListeners
()
Removes all listeners for this object
Removes all listeners for this object
|
Roo.util.Observable | |
refresh
()
Refreshes the view.
Refreshes the view. - called by datachanged on the store. - do not call directly.
|
Roo.View | |
refreshNode
(Number index)
Refresh an individual node.
Refresh an individual node.
|
Roo.View | |
Roo.util.Observable | ||
Selects nodes.
Selects nodes.
|
Roo.View | |
setStore
(Store store)
Changes the data store this view uses and refresh the view.
Changes the data store this view uses and refresh the view.
|
Roo.View | |
Roo.util.Observable | ||
Unselects nodes.
Unselects nodes.
|
Roo.View |
Event | Defined By | |
---|---|---|
Fires before a click is processed.
Fires before a click is processed. Returns false to cancel the default action.
|
Roo.View | |
Fires before a selection is made.
Fires before a selection is made. If any handlers return false, the selection is cancelled.
|
Roo.View | |
Fires when a template node is clicked.
Fires when a template node is clicked.
|
Roo.View | |
Fires when a template node is right clicked.
Fires when a template node is right clicked.
|
Roo.View | |
Fires when a template node is double clicked.
Fires when a template node is double clicked.
|
Roo.View | |
Roo.View | ||
Roo.View |