Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: How to remove close button from A.Modal
Hi, a need remove close button on top right place from A.Modal. Thanks a lot. Below is my code from basic examples which I use.
<div class="yui3-skin-sam">
<div id="modal"></div>
</div>
YUI().use(
'aui-modal',
function(Y) {
var modal = new Y.Modal(
{
bodyContent: 'Modal body',
centered: true,
headerContent: '<h3>Modal header</h3>',
modal: true,
render: '#modal',
width: 450
}
).render();
}
);
Hi Vas,
The AUI Modal has an attribute called "toolbars". You can pass in whatever contents you want to certain toolbar sections. If you are looking to remove the header close button, you can pass in a blank array to the header toolbar like below:
I hope this helps! Please let me know if you have any questions. Thanks!
The AUI Modal has an attribute called "toolbars". You can pass in whatever contents you want to certain toolbar sections. If you are looking to remove the header close button, you can pass in a blank array to the header toolbar like below:
YUI().use(
'aui-modal',
function(Y) {
var modal = new Y.Modal(
{
bodyContent: 'Modal body',
centered: true,
headerContent: '<h3>Modal header</h3>',
modal: true,
render: '#modal',
toolbars: {
header: []
}
width: 450
}
).render();
}
);
I hope this helps! Please let me know if you have any questions. Thanks!
Hi, super it works but ... still one small questions.
I need to no headerContent so I remove this line headerContent: '<h3>Loading</h3>', , but in window stay white empty row --> how remove all this row?
Thanks a lot.
I need to no headerContent so I remove this line headerContent: '<h3>Loading</h3>', , but in window stay white empty row --> how remove all this row?
Thanks a lot.
Hi,
To remove "toolbar" you have to set toolbar attribute to "false". The toolbar DIV will not be generated.
If you want to remove header and toolbar both without any junk DIV. Try below code :
Thanks
To remove "toolbar" you have to set toolbar attribute to "false". The toolbar DIV will not be generated.
YUI().use(
'aui-modal',
function(Y) {
var modal = new Y.Modal(
{
bodyContent: 'Modal body',
centered: true,
headerContent: '<h3>Modal header</h3>',
modal: true,
render: '#modal',
toolbars: false,
width: 450
}
).render();
}
);If you want to remove header and toolbar both without any junk DIV. Try below code :
YUI().use(
'aui-modal',
function(Y) {
var modal = new Y.Modal(
{
bodyContent: 'Modal body',
centered: true,
modal: true,
render: '#modal',
toolbars: false,
width: 450
}
).render();
}
);Thanks
Perfect. Second example it's exactly what I need. :-)
Thanks a lot.
Thanks a lot.
Works perfect Jonathan...Thanks