Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion accessing $data in afterRender function call
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Best  
View profile  
 More options May 21 2012, 4:32 pm
From: Michael Best <mb...@dasya.com>
Date: Mon, 21 May 2012 13:32:42 -0700 (PDT)
Local: Mon, May 21 2012 4:32 pm
Subject: Re: accessing $data in afterRender function call
By specifying it as refreshListview(), the function gets called when
the binding is parsed, which is before foreach is run. Since your
function doesn't return anything, afterRender is just set to
undefined.

There is currently an open request to add a callback like you want:
https://github.com/SteveSanderson/knockout/pull/339

Another option is to use a custom binding: http://jsfiddle.net/mbest/439nV/10/

-- Michael

On May 20, 7:45 pm, hughb...@gmail.com wrote:

> Hey I got it figured out.
> See my Fiddle here:http://jsfiddle.net/439nV/
> I needed to add parentheses to my afterRender binding.

> THIS IS CORRECT:
> <!-- ko foreach: {data: getFiveItems(), afterRender: refreshListview()} -->

> THIS IS NOT CORRECT:
> <!-- ko foreach: {data: getFiveItems, afterRender: refreshListview} -->

> Thanks!
> Hugh


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.