I'm having some issues with knockout binding to a collapsible panel (for mobile) and am hoping that someone can help.
Here's what I'm trying to accomplish:
I have a form with a summary, and dynamically created panels. On these panels, the header is bound to a Branch Name. Content contains summary info.
Within each [Branch Name] heading, I'd like to add an "Edit" button (on the right) which, when clicked, would a) replace itself with "Save" and "Cancel" buttons ad b) hide all other "Edit" buttons in the remaining sections. When the Save or Cancel action is invoked, All Edit buttons are visible again.
When in Edit mode, I'd like the label to be replaced with an input field
And of course I'm assuming all of this would require custom [ko] bindings - but I just can't seem to figure it out.
Thanks in advance!
<div data-role="collapsible" data-collapsed="false" data-mini="true" data-theme="a" data-inset="false" data-collapsed-icon="arrow-d" data-expanded-icon="arrow-u" data-enhance="true">
<h4><span data-bind="text: Name"></span>
This is where I'd like the EDIT, SAVE and CANCEL buttons
</h4>
<div class="ui-grid-a">
<div class="ui-block-a">Bulk Interest</div>
<div class="ui-block-b"><span data-bind="text: Interest"></span>
</div>
<div class="ui-block-a">Adjustments</div>
<div class="ui-block-b"> <span data-bind="text: Adjustments"></span>
</div>
<div class="ui-block-a">Current</div>
<div class="ui-block-b"><span data-bind="text: Current"></span>
</div>
</div>
PS: Here's a sample Fiddle (http://jsfiddle.net/sal_andani/pvsky/)