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",
template : '<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 | |
---|---|---|
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 | |
selectedClass : String
The css class to add to selected nodes
The css class to add to selected nodes
|
Roo.View | |
store : Roo.data.Store
Data store to load data from.
Data store to load data from.
|
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 | |
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.
|
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.
|
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 |
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 |