Closed Jusys closed 6 years ago
Look here: https://jsfiddle.net/petersirka/r0kmhtvw/
BTW: please use Total.js messenger for future questions: https://messenger.totaljs.com or my channel https://messenger.totaljs.com/petersirka/
I forgot to answer:
<button onclick="window.forma.Name='kuku'">Ok</button>
SET()
, UPDATE()
, etc. methods<button onclick="SET('forma.Name', 'kuku')">Ok</button>
Dėkoju.
P.S. I thought that there is some automatic cycle, that checks values, like in angular..
It's because of performance, but you can use jComponent CREATE()
(A simple wrapper for Proxy
object):
https://jsfiddle.net/petersirka/r0kmhtvw/4/ It doesn't work in IE: https://caniuse.com/#search=proxy
How does automatic two-way data binding work? I have such code:
<div data-jc="textbox" data-jc-path="forma.Name" data-jc-bind="">Name</div>
<button onclick="window.forma.Name='kuku'">Ok</button>
<script>
window.forma = {};
window.forma.Name = 'labas';
</script>
On page loading textbox is assigned value 'labas', but when I click Ok - textbox value does not change. When I call
MAIN.update()
- only then value changes.Is this a bug or I'm missing something?
3.0.0 jComponent v15