javascript - knockout - get value from parent array -


below snippet of html containing knockout bindings. if first/outer foreach loop goes through array called tradesobservablearray contains key called "threadid", how can value have: **$root.threadid**? please note $root.threadid in inner foreach loop.

basically, $root.threadid returns undefined. i've tried $parent.threadid same result.

thanks in advance ...

 <div id="tradesthread" data-bind="foreach: tradesobservablearray">              <table>                 <tbody data-bind="foreach: $root.filesobservablearray">                     <tr id="traderow">                         <td data-bind="visible: $root.traderowfiles(**$root.threadid**, commentid)"><span data-bind="text: filename"></span></td>                     </tr>                 </tbody>             </table>            </div> 

if threadid observable object can value calling:

$parent.threadid() 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -