Title: can i bind event to component after markup init ? Post by: yulei on April 19, 2015, 06:15:14 PM I like the markup style very much,component can be declare by html with less javascript.
the html is readable , the javscript block is clear. but, i have an obsession for javacirpt in html : I don't want any javascript code in the html markup. the best style I want is like this: the html code: Code: <div id='the_id' data-options= 'only options here ' class='esayui-component-name' Code: $('#the_id').component-name('bind','eventName',function(){ Title: Re: can i bind event to component after markup init ? Post by: stworthy on April 19, 2015, 11:17:51 PM You can declare all the properties on the markup and then create this component using javascript. When creating a component using javascript, you can add any other properties and events, please remember to remove the "easyui-*" class from the markup.
The code below declare some properties on the <input> element except the 'easyui-textbox' class. Code: <input id="tb" style="width:200px" data-options=" You can create the textbox component using javascript. Code: $(function(){ |