Ember.RenderBuffer Class packages/ember-views/lib/system/render_buffer.js:78
Defined in: packages/ember-views/lib/system/render_buffer.js:78
Module: ember-views
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.
1 |
var buffer = Ember.RenderBuffer('div'); |
Methods
Properties
addClass
(className)
Adds a class to the buffer, which will be rendered to the class attribute.
Parameters:
- className String
- Class name to add to the buffer
attr
(name, value)
Ember.RenderBuffer|String
Adds an attribute which will be rendered to the element.
Returns:
- Ember.RenderBuffer|String
- this or the current attribute value
element
DOMElement
Returns:
- DOMElement
- The element corresponding to the generated HTML of this buffer
prop
(name, value)
Ember.RenderBuffer|String
Adds an property which will be rendered to the element.
Returns:
- Ember.RenderBuffer|String
- this or the current property value
push
(string)
Adds a string of HTML to the RenderBuffer
.
Parameters:
- string String
- HTML to push into the buffer
removeAttr
(name)
Remove an attribute from the list of attributes to render.
Parameters:
- name String
- The name of the attribute
removeProp
(name)
Remove an property from the list of properties to render.
Parameters:
- name String
- The name of the property
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: []
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
// The root view's element _element: null, _hasElement: true, /**
Default: []
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
1 |
Ember.RenderBuffer('p')
|
Default: null
parentBuffer
Ember._RenderBuffer
Nested RenderBuffers
will set this to their parent RenderBuffer
instance.