|
Dialog Widget
Dialog is an enhanced panel. It is used to group a set ou UI elements and isolate them from other UI components. Dialog supports all the panel configuring options.
Basic Usage $.domLoaded(function() {
$.get("#pan").widget("dialog", CONFIG_JSON );
}
Configuring Options
It contains array of JSON objects. The properties are mentioned below.
Methods
Dialog Widget Examples Example 1
JS
HTML
$.domLoaded( function() {
$.get("#dial1").widget("dialog", {
head : {
title : "Simple Dialog"
},
dim : { wid : 300, ht : 200},
pos : { x : 20, y : 20},
});
});
Result
Example 2
JS
HTML
$.domLoaded( function() {
$.get("#dial1").widget("dialog", {
head : {
title : "Closeable Dialog"
},
dim : { wid : 300, ht : 200},
pos : { x : 10, y : 40},
close : true
});
});
Result
Example 3
JS
HTML
$.domLoaded( function() {
$.get("#dial1").widget("dialog", {
head : {
title : "Draggable Dialog"
},
dim : { wid : 200, ht : 200},
pos : { x : 500, y : 40},
draggable: true
});
$.get("#par").widget("panel", {
dim : { wid : 400, ht : 400}
});
$.get("#dial2").widget("dialog", {
head : {
title : "Draggable Dialog Within Parent"
},
dim : { wid : 200, ht : 200},
pos : { x : 10, y : 40},
draggable: "parent"
});
});
Result
Example 4
JS
HTML
$.domLoaded( function() {
$.get("#dial1").widget("dialog", {
head : {
title : "Maximize Dialog"
},
dim : { wid : 200, ht : 200},
pos : { x : 500, y : 40},
maximize : "document",
});
$.get("#par").widget("panel", {
dim : { wid : 400, ht : 400}
});
$.get("#dial2").widget("dialog", {
head : {
title : "Maximize Within Parent"
},
dim : { wid : 200, ht : 200},
pos : { x : 10, y : 40},
maximize : "parent"
});
});
Result
Example 5
JS
HTML
$.domLoaded( function() {
$.get("#dial1").widget("dialog", {
head : {
title : "Resizable Dialog"
},
dim : { wid : 300, ht : 200},
pos : { x : 10, y : 40},
resizable : true,
});
});
Result
Example 6
JS
HTML
$.domLoaded( function() {
$.get("#dial1").widget("dialog", {
head : {
title : "Combined Dialog"
},
dim : { wid : 300, ht : 200},
pos : { x : 10, y : 40},
close : true,
draggable : true,
maximize : "document",
resizable : true,
});
});
Result
Example 7
JS
HTML
$.domLoaded( function() {
$.get("#dial1").widget("dialog", {
head : {
title : "Modal Dialog"
},
dim : { wid : 300, ht : 200},
pos : { x : 250, y : 50},
resizable : true,
draggable : true,
close : true,
modal : true
});
});
Result
Example 8
JS
HTML
$.domLoaded( function() {
$.get("#par").widget("panel", {
dim : { wid : 400, ht : 400}
});
var dial1 = $.get("#dial1").widget("dialog", {
head : {
title : "External Events"
},
dim : { wid : 200, ht : 200},
pos : { x : 40, y : 40},
resizable : true,
draggable : "parent",
maximize : "parent",
close : true,
show : false,
});
$.get("#show").on("click", function() {
dial1.show();
});
$.get("#close").on("click", function() {
dial1.close();
});
$.get("#max").on("click", function() {
dial1.maximize();
});
});
Result
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
