ember.js - Ember JS to bind helpers inside specific div -
here facing problem bind ember.textfield <div id="bindhere"></div>
through indexcontroller without using template format. because appearing @ end of code.
here template
<script type="text/x-handlebars" id="index" > < button {{action "select" on="click"}}>ok </button> {{outlet}} </script> **here controller** app = ember.application.create(); app.indexcontroller = ember.objectcontroller.extend({ actions: { select: function(param1, param2) { ember.textfield.create({ classnames: ['btn btn-sm btn-danger glyphicon glyphicon-pencil'], type: 'button', attributebindings: ['value'], value: "new button", action: '{{formeditchangefinder}}' , onevent: 'click', //attributebindings: ['on'], on: ['click'] eventmanager: ember.object.create({ click: function(event, view) { alert("working"+elementname); } }) }).append(); } } });
here have attached following thing in js-bin http://jsbin.com/dupagi/1/
if got question correct -
check out demo
basically have give id div want append -
<div style="bindhere" id="bindhere"></div>
and -
app.indexcontroller = ember.objectcontroller.extend({ actions: { select: function(param1, param2) { var bindhere = $('#bindhere'); ember.textfield.create({ classnames: ['btn btn-sm btn-danger glyphicon glyphicon-pencil'], type: 'button', attributebindings: ['value'], value: "new button", action: '{{formeditchangefinder}}' , onevent: 'click', //attributebindings: ['on'], on: ['click'] eventmanager: ember.object.create({ click: function(event, view) { alert("working"+elementname); } }) }).appendto(bindhere); } } });
Comments
Post a Comment