0

On the page I have only one script, in the head (it is like some advertisement). And in content client have a knockoutjs temlating, and they have filter select.

I need to invoke my stuff after select filtering. When user click to filter smth, and before content will be visible, I need to invoke some stuff (in the same thread).

How I can do this ? Have you any idea ?

P.S. So as you understand I do not have possibility to change basic template logic, which is sent from server, I can to use smth in the head (I have script there).

1 Answers1

1

Use afterRender property in template binding

Note 4: Using “afterRender”, “afterAdd”, and “beforeRemove”

Documentation - template

Excample:

<div data-bind='template: { name: "personTemplate",
                            data: myData,
                            afterRender: myPostProcessingLogic }'> </div>
Ilya
  • 29,135
  • 19
  • 110
  • 158
  • But i have not template name. The data-binds looks like so: data-bind="template: {name:quoteTemplate()}". Also each element will be replaced with another one, after each filter call. So I think this attribute will be the same as in default. – Oleksandr Tserkovnyi Aug 21 '13 at 14:46