'Knockoutjs containerless control flow
I seem to have an issue with the containerless control flow. When the page is loaded initially it works correctly, when the field gu_catCnt is updated (I can see it in the model getting updated), the page is still static. The field is in the format: viewModel -> Fields -> [3] -> gu_catCnt, Where [3] is the 4 element in an array - could this be the issue?
<!-- ko if: ((parseInt(gu_catCnt) > 0)-->
<select data-bind="options: gu_allCats,
optionsValue: ca_Value,
optionsText: ca_Text,
selectedOptions: gu_Value,
value: $data"</select>
<!-- /ko -->
Many thanks
Solution 1:[1]
If it's working on page load and and doesn't update when the property changes, then gu_catCnt
is probably a regular property and not an observable
. Change it an observable:
gu_catCnt: ko.observable("0")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | adiga |