Ember.RenderBuffer Class
Ember.RenderBuffer
gathers information regarding the a view and generates the
final representation. Ember.RenderBuffer
will generate HTML which can be pushed
to the DOM.
var buffer = Ember.RenderBuffer('div');
Constructor
Ember.RenderBuffer
-
tagName
Parameters:
-
tagName
Stringtag name (such as 'div' or 'p') used for the buffer
Item Index
Methods
Methods
addClass
-
className
Adds a class to the buffer, which will be rendered to the class attribute.
Parameters:
-
className
StringClass name to add to the buffer
attr
-
name
-
value
Adds an attribute which will be rendered to the element.
Returns:
this or the current attribute value
element
()
DOMElement
Returns:
The element corresponding to the generated HTML of this buffer
prop
-
name
-
value
Adds a property which will be rendered to the element.
Returns:
this or the current property value
push
-
string
Adds a string of HTML to the RenderBuffer
.
Parameters:
-
string
StringHTML to push into the buffer
removeAttr
-
name
Remove an attribute from the list of attributes to render.
Parameters:
-
name
StringThe name of the attribute
removeProp
-
name
Remove an property from the list of properties to render.
Parameters:
-
name
StringThe name of the property
Properties
classes
Array
Array of class names which will be applied in the class attribute.
You can use setClasses()
to set this property directly. If you
use addClass()
, it will be maintained for you.
Default: null
elementAttributes
Hash
A hash keyed on the name of the attribute and whose value will be
applied to that attribute. For example, if you wanted to apply a
data-view="Foo.bar"
property to an element, you would set the
elementAttributes hash to {'data-view':'Foo.bar'}
.
You should not maintain this hash yourself, rather, you should use
the attr()
method of Ember.RenderBuffer
.
Default: {}
elementClasses
Array
private
An internal set used to de-dupe class names when addClass()
is
used. After each call to addClass()
, the classes
property
will be updated.
Default: null
elementId
String
The id in of the element, to be applied in the id attribute.
You should not set this property yourself, rather, you should use
the id()
method of Ember.RenderBuffer
.
Default: null
elementProperties
Hash
A hash keyed on the name of the properties and whose value will be
applied to that property. For example, if you wanted to apply a
checked=true
property to an element, you would set the
elementProperties hash to {'checked':true}
.
You should not maintain this hash yourself, rather, you should use
the prop()
method of Ember.RenderBuffer
.
Default: {}
elementStyle
Hash
A hash keyed on the name of the style attribute and whose value will
be applied to that attribute. For example, if you wanted to apply a
background-color:black;
style to an element, you would set the
elementStyle hash to {'background-color':'black'}
.
You should not maintain this hash yourself, rather, you should use
the style()
method of Ember.RenderBuffer
.
Default: {}
elementTag
String
The tagname of the element an instance of Ember.RenderBuffer
represents.
Usually, this gets set as the first parameter to Ember.RenderBuffer
. For
example, if you wanted to create a p
tag, then you would call
Ember.RenderBuffer('p')
Default: null
parentBuffer
Ember._RenderBuffer
Nested RenderBuffers
will set this to their parent RenderBuffer
instance.