I am using a jeasyui dialog box which opens when clicked on a form button. But even when the dialog is open I am able to change the form behind. I want that when the dialog box is opened it should be closed first before anything else in the background becomes editable/ clickable.
How do I achieve that?
make sure your dialog set modal:true like this
$("#dialog").dialog({
autoOpen: false,
width: 550,
modal: true,
hide: 'fade',
show: 'fade',
closeOnEscape: false,
draggable: true,
resizable: true,
title: 'My Dialog'
});
Related
I am making small code editor and i want user to be able to resize window if user wants. I have main window property non resizable.
mainWindow = new BrowserWindow({width: 800, height: 600 , resizable: false});
I have button
I have drop down menu :
label: 'Screen',
submenu:[
{
label:'Resizable Window',
click(){
mainWindow.resizable = false;
}
},
My code doesn't work. Please help me to fix it.
To change if a window is resizable you have to call mainWindow.setResizable(false) instead of .resizable = false.
And it seems that you're setting resizable to false when it's already false, I think you want to set it to true to enable resizing.
In summary you would end up with something like:
label: 'Screen',
submenu: [
{
label: 'Resizable Window',
click () {
mainWindow.setResizable(true);
}
},
],
.setResizable Docs.
I've got myself trying to create a dialog with a progress bar in dojo.
When it is visible, on an onshow event, I want to trigger a recursive function to process code, and update the progress bar. Problem is, the onshow fires before the dialog is visible, and the recursive processing completes and destroys the dialog with progress bar before it even becomes visible
Here's a vague code sample (ignore some of the custom classes, like panelManager, etc. When the dialog shows, I have a function I wish to call..
register_dialog = panelManager.getActive();
//createPanel(panelManager.getActive().domNode, true, '', "Number of " + text_correction("Sample")+"s Registered", '', null, 90, 290, null, false, null);
dialog = new dialog_simple({
title: "Number of " + text_correction("Sample")+"s Registered",
isLayoutContainer: true,
containerNode: register_dialog.domNode,
href: "blank.html",
preload: true,
parseOnLoad: true
});
dialog.domNode.style.width = "290px";
dialog.domNode.style.height = "70px";
progress = new ProgressBar({
style: "width:270px",
id: "register_progress",
maximum: numOfSamples,
value: 0,
label: "0 of " +numOfSamples
});
dialog.on("show", function() {
startRegister(theJSON, theHeaderData, currentSample, theSamples, dialog, progress, register_dialog);
});
dialog.on("cancel", function() {
dijit.registry.remove(progress.id);
progress.destroy();
dialog.destroyRecursive()
});
dialog.set("content",progress);
progress.startup();
dialog.startup();
dialog.show();
ANYWAY, it fires the function before the dialog is visible... ideas?
I am trying to create a popup using aui script tag and i don't no why its not working
please have a look at the code
function popup(url){
AUI().use('aui-dialog', function(A){
var dialog = new A.Dialog({
title: 'Book Details',
centered: true,
modal: true,
width: 500,
height: 400
}).plug(A.Plugin.IO,{uri: url}).render();
});
}
Have a look into following links it may help you..
http://www.liferaysavvy.com/2013/11/working-with-liferay-alloy-ui-dialogs.html
http://www.liferaysavvy.com/2013/12/open-liferay-portlet-in-aui-dialogpopup.html
I have a JQuery Modal Form and when i add the submit event, it cannot display as dialog but rather than embedded into browser window. If I uncomment the click event below, it will embedded into browser window rather than show as dialog.
$(document).ready(function(){
//$("#moveTicketBtn").click() {
// $("#moveUnknownTicket").submit();
//};
$("#moveUnknownTicketDialog").dialog(
{
title: "Move Unknown Ticket",
autoOpen: true,
modal: true,
resizable: true,
stack: true,
width: 500,
height: 350
});
});
Does anyone have any idea why it is like this? Please help. Thanks.
EDIT Question:
I have a form inside this dialog and upon submission(onsubmit, onblur) the javascript is not called. What is the reason?
try
$("#moveTicketBtn").click(function() {
$("#moveUnknownTicket").submit();
});
you have to insert your function within the () of the click event.
more information here: http://api.jquery.com/click/
That should do the trick:
http://jsfiddle.net/uQCKJ/
As you can see the form is submitted, since the alert box is triggered
$("#moveTicketBtn").click(function() {
$("#moveUnknownTicket").submit();
});
I have put submit inside click function though works great.
Using jquery qTip2 for tooltips.
I have a tooltip with a link in it. I want the tip to stay open if the user's mouse enters the tip (not the trigger). Can't seem to figure out how to do that in the documentation....
If you want it to remain visible when you mouse over and into the tip, but still want it to dismiss on mouseout, use the fixed and delay options as described in the documentation here:
$('.selector').qtip({
content: {
text: 'I hide on mouseout, but you can mouse into me within 500ms',
},
hide: {
fixed: true,
delay: 500
}
});
The hide parameter has many options. For example, if you just want to not hide it indefinitely, simply set hide to false:
$('.selector').qtip({
content: {
text: 'I never hide',
},
hide: false
});
If you want it to hide on a different event, such as clicking anywhere outside the tip, set the event explicitly:
$('.selector').qtip({
content: {
text: 'I hide when you click anywhere else on the document',
},
hide: {
event: 'unfocus'
}
});
If you want it to hide when the trigger is clicked, specify the click event:
$('.selector').qtip({
content: {
text: 'I hide when you click the tooltip trigger',
},
hide: {
event: 'click'
}
});
See specifically the "hide" options documentation for more info.
If you want the tip to stay open and then hide it when the user clicks outside the target or leaves the target:
show: {
event: 'mouseover'
},
hide: {
event: 'click mouseleave'
}