I am opening a modal dialog on click of button.
<input data-bind="click: review" class="button" type="button" value="review" />
On button click:
$('#divModal').dialog("open");
Below is the code which I have in my document.ready to call a modal dialog.
$('#divModal').dialog({
autoOpen: false,
modal: true,
width: 400,
height: 700,
buttons: {
Close: function () {
$(this).dialog("close");
}
}
});
In my apply bindings, I have all the values of my observable arrays. I am binding these values in my form. I want to pass same values to my modal popup.
I tried the below code in html:
<div id="divModal">
<section data-bind="visible: myCondition() === 'Readers'">
<div>Readers List Goes here</div>
</section>
<section data-bind="visible: myCondition() === 'Writers'">
<div>Writers List Goes Here</div>
</section>
<section data-bind="visible: myCondition() === 'Others'">
<div>Others List goes here</div>
</section>
</div>
myCondition
is an observable array.
I am able to display its value in the html. "Apply Bindigs" takes care of this.
I am unable to display its value in the modal dialog.
I have a bunch of other elements which I want to pass to this modal dialog.
How do I call a function when the modal dialog opens - so that I can pass all my values to this function?
Could anyone help me here?
Thanks!