Class: View

View

new tart.components.View()

View class base

Members

domElement

protecteddomCache

Methods

Clears the view's dom cache. This might come in handy where you find yourself with dangling HTMLElement's who are not in DOM anymore but bugs you because they are in cache. This also helps with memory leaks; you should often clear your cache. TODO: Make this default with a deconstructor for view

get(key){Object}

Get item, which is indicated on domMappings node Cache them to domCache and return item Example of usage with an id as selector: this.get("[id='elementId']") or this.get("[id=elementId]")

Name Type Description
key string

Object key from domMappings node.

Returns:
Type Description
Object found object after traverse.

getDOM(){Element}

get current DOM reference

Returns:
Type Description
Element

render(){string}

Render abstract method, which all subclasses should implement

Throws:
Error
Returns:
Type Description
string

Sets base DOM tree for component

Name Type Description
dom Element

base DOM reference for component.