Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to bind to "self" in WinJS

When I'm using the default data binding in WinJS, how do I bind to the "current item" instead of specifying a property to bind to. I'm think of the "." in XAML that binds to the current item.

like image 278
Jeremy Foster Avatar asked Dec 20 '25 05:12

Jeremy Foster


1 Answers

You can use "this" on the right side of the binding expression:

data-win-bind="innerText: this myInitializer"

However, if you do so, you should write a custom initializer that knows how to pull apart "this" into something that correctly turns into a string.

like image 67
Chris Tavares Avatar answered Dec 21 '25 23:12

Chris Tavares



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!