knockout-jqueryui icon indicating copy to clipboard operation
knockout-jqueryui copied to clipboard

dialog button handlers' "this" bound to dialog, not viewmodel

Open oising opened this issue 10 years ago • 2 comments

I see you've fixed up the events to get bound to the viewmodel, but the following binding does not work correctly:

<div data-bind="dialog: { isOpen: $root.isEditMode, buttons: { Save: $root.save} }"></div>

In the save function, this is bound to the jquery dialog, not the viewmodel.

oising avatar Dec 08 '14 21:12 oising

Did you ever get this problem solved. I am facing the same issue.

RolfVeinoeSorensen avatar Sep 01 '15 19:09 RolfVeinoeSorensen

I created a work around where I did not add the buttons through the handler but just added it to the dialog div like this:

RolfVeinoeSorensen avatar Sep 01 '15 19:09 RolfVeinoeSorensen