0

trying to have a function get executed once in a custom binding handler to resize some divs based on their contents. I am able to easily do this in angularjs but I am trying to find something that behaves like $evalAsync for knockout.

http://docs.angularjs.org/api/ng.$rootScope.Scope

Is there a feature like this I can hook into?

it's for koGrid 2.0 auto-widths. Right now it only works on single page apps because I am hooking into document.ready :(

https://github.com/ericmbarnard/KoGrid

Kyeotic
  • 19,697
  • 10
  • 71
  • 128
timothyswt
  • 559
  • 5
  • 7
  • What, exactly, are you attempting to do? Just resize a div based on some content? I don't feel like I have enough information to answer your question. I'm sure, however, that trying to do Angular however you're using to doing Knockout is like trying to drive a race car the same way you're used to riding a unicycle. It's apples and oranges. – Ben Lesh Dec 05 '12 at 20:09
  • basically I need to detect when a template is loaded or after dom is rendered so I can get the elements and measure their contents to set the width of a column. But I can't just "guess" what the length will be. – timothyswt Dec 06 '12 at 06:40

1 Answers1

-1

Maybe the afterRender callback can be used?

http://knockoutjs.com/documentation/template-binding.html#note_4_using_afterrender_afteradd_and_beforeremove

sphair
  • 1,674
  • 15
  • 29