knockout.js - hiding the close button on a Jquery dialog that is bound to knockout view model -
i need hide jquery dialog close button (the 'x' on top right corner) on dialog bound knockout view model.
here div knock out binding
<div id="rundialog" data-bind="dialog: { autoopen: autoopendialog, modal: isdialogmodal, title: dialogtitle }, opendialog: dialogitem"> </div
this utilizing knockout.bindings.js
in past have been able control using open event , hide way
open: function (event, ui) { $(".ui-dialog-titlebar-close", ui.dialog).hide(); },
i can add knockout dialog binding, pretty ugly have better way here? thanks!
you should use next construction, desribed on jquery dialog api page in section
hiding close button
1) add css rule
.no-close .ui-dialog-titlebar-close { display: none; }
2) in knockout binding use dialogclass: 'no-close'
<div id="rundialog" data-bind="dialog: { autoopen: autoopendialog, modal: isdialogmodal, title: dialogtitle, dialogclass : 'no-close' }, opendialog: dialogitem"> </div>
Comments
Post a Comment