I have multiple WijDialogs one above the other. Say flow comes like this:
Search Dialog -> Results Dialog -> Save Results Dialog
Consider control is currently in Results dialog which is above Search Dialog, when I move the Dialog I can still see the Search Dialog in the background.
But it is in the blur state because it lost its focus.
I want to make the background dialog completely hidden (make it invisible without closing the search dialog). It should be visible again on closing the Results Dialog .
I tried hiding the Div container of the Search Dialog, but still I can see the title bar.
I can hide the title bar completely by using $(".ui-dialog-titlebar").hide(); but I don’t know how to unhide or show the title bar.
In short, I want to make the background dialog invisible and visible with out losing the values I entered in it previously.
You can call the 'close' method of the first wijdialog to close it and then call its 'open' method in the close event of the second dialog. The data entered in the first dialog is retained until wijdialog is reinitialized. Please see the code below:
$('#dialog2').wijdialog({
autoOpen: false,
stack: true,
modal: true,
open: function () {
$('#dialog1').wijdialog('close');
},
close: function () {
$('#dialog1').wijdialog('open');
}
});
Related
How and where I need to set the data-close-on-click params in my off-canvas to avoid the menu to close when user click on a link inside the menu?
Using jquery:
$('#yourDatePickerID').click(function(e)
e.stopPropagation();
e.preventDefault();
});
Depending on which date picker you are using this may or may not work. It may even not allow you to open the calendar image. If it doesn't work I suggest you look into what event for your date picker is fired when the ok button is clicked. Attach this code to that event instead of the click event and try again.
I'm making a Master/Details app with Template 10. The Master/Details Template 10 sample uses a CommandBar to get full control over when the back button is shown, but I'd like to show the back button on a PageHeader or on the shell. The problem is, since there is no back stack, the button refuses to be shown. How should I handle this?
Override the OnNavigatedTo event and set AppViewBackButtonVisibility to Visible in the code-behind file for each page that you want to enable the title bar back button.
Take a look here: http://grogansoft.com/blog/?p=1116
The important part is "AppViewBackButtonVisibility"
if (rootFrame.CanGoBack)
{
// Show UI in title bar if opted-in and in-app backstack is not empty.
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
AppViewBackButtonVisibility.Visible;
}
I also suggest you take a look at the AppBar properties.
Especially the Visibility which gets or sets the visibility of a UIElement and you could force the visibility of an item:
https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.appbar.aspx
So I've created a hacky solution to this. Basically I'm adding a dummy value onto the stack so that the back button thinks there is something to go back to.
var entry = new PageStackEntry(typeof(bool), null, null);
Frame.BackStack.Insert(0, entry);
Then I've added a BootStrapper.BackRequested event which sets HandledEventArgs.Handled to true so Template10 doesnt actually pop the page. That way I've got full control over the back stack and the back visibility.
I'm having an annoying little interaction issue with qTip 2. A button on my page has a tip attached to it, set to appear on mouseover after a 500ms delay and disappear immediately on mouseout.
When the button is clicked, the whole view changes and that particular button disappears, so I force the tip to hide immediately (otherwise, it hangs around until the user moves their mouse, even though the button that triggered it is no longer visible).
The problem is that the immediate hide event doesn't seem to cancel the delayed show event if it happens to occur first. In other words, if the user points at the button and clicks it in less than 500ms, the hide event triggers (doing nothing) and then the show event triggers at 500ms, causing the tooltip to display even thought the button is no longer there (and in the wrong position to boot, since it can't position itself correctly without the button being visible).
Is there a way when I trigger the hide event to tell it to just stop there and not perform any other events?
Not Tested
You can use the show event to check if the button visible , and if not than don't show it....
Something like this:
events: {
show: function(event, api) {
var target = event.originalEvent.target;
if($("#idOfButton").length === 0 ) {
event.preventDefault();
//or try this (commednt the above and uncomment the code below)
//clearTimeout(api.timers.custom);
}
}
}
I solved it like this (#Daniel, your answer was close so I'll upvote you too):
events: {
show: function(event, api) {
if ($("#mybutton").is(':hidden')) {
try { event.preventDefault(); } catch(e) {}
}
}
};
This is the method that qTip's documentation recommends.
I have a dialog with a checkbox inside on a jsp page. This dialog opens when a hyperlink is clicked.
The functionality that I am trying to achieve is governed by following rules:
The dialog should only close when the checkbox inside is checked.
If the dialog is reopened and the checkbox is already checked, the user can click anywhere on the page to close it.
If the dialog is reopened and the checkbox is not checked or unchecked, then user can only close the dialog by checking the checkbox.
function closeDialog() {
var checked = $('.checkboxClass').attr('checked');
$('.ui-widget-overlay').live('click', function() {
if(checked){
$('#'+divId).dialog('close');
}else{
<!-- since unchecked, dialog should not be closed-->
//$(document).unbind('click');
//$('.ui-widget-overlay').unbind('click');
$('.ui-widget-overlay').die('click');
}
});
}
<!-- This detects if checkbox is clicked-->
$('.checkboxClass').live('click', function() {
var checked = $('.checkboxClass').attr('checked');
if(checked){
$('#'+divId).dialog('close');
}
});
I have tried all things to perform step 3, ie, prevent the dialog from being closed if user clicks anywhere outside dialog, but it gets closed. Any Ideas?
I am using jQuery 1.4 and hence would prefer to retain .live() which i know is deprecated.
Try changing your .ui-widget-overlay event bind to
$('.ui-widget-overlay').live('click', function(e) {
...
Then do a e.stopPropagation() in the else?
I am calling one dialog box from another.....before calling 2nd dialog box i am hiding the 1st dialog box using ShowWindow(SW_HIDE) and after finishing the operation on 2nd dialog box i destroy it....now when the control comes back to the function i am using ShowWindow(SW_SHOW) to show the 1st dialog again but it remains hidden..can anybody help me how to show it again????
EX:
Funcn(){
ShowWindow(SW_HIDE);//hide the dialog box 1st
SecondDlg var;//Class variable of 2nd dialog box
var.DoModal();//call the 2nd dialog box
ShowWindow(SW_SHOW);//after executing this statement the dialog still remains hidden...how to show it??
}
Maybe you want to call ShowWindow(SW_RESTORE) instead of SW_SHOW?