javascript - How to bind event in knockout.js in dynamically added content? -


I want to add some content to my page after data binding, example:

  Li & gt; & lt; div & gt; text & lt; / div & gt; & lt; div data-bind = 'event: {click: select dialog}' & gt; & lt; / Div> & lt; / li & gt; ".appendTo ($ (" #userClientGroup "). Search (" #earch-customer-ul-UCG "));  

However, in this case the click event is not working; Can someone give me the solution?

You ko.applybindings (viewModel, $ ('#yourNewElement')) Just be careful that you do not try to force an element, or you will receive an error.


Comments

Popular posts from this blog

Editing Python Class in Shell and SQLAlchemy -

import - Python ImportError: No module named wmi -

uislider - In a MATLAB GUI, how does one implement a continuously varying slider from a GUIDE created .m file? -