EasyUI Forum
December 05, 2025, 11:30:16 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: css class to a dialog  (Read 9542 times)
korenanzo
Guest
« on: March 25, 2016, 11:22:53 AM »

Hi,

how can I add a css class to a dialog() ?
using 'cli' does not work:
$('#dd').dialog({
    title: 'My Dialog',
    width: 400,
    height: 200,
    closed: false,
    modal: true,
   cos:'myClass'
});
Logged
jarry
Administrator
Hero Member
*****
Posts: 2303


View Profile Email
« Reply #1 on: March 25, 2016, 11:38:10 PM »

Just call 'addClass' method to add a class to the dialog.
Code:
$('#dd').addClass('cli').dialog({
...
});
Logged
korenanzo
Guest
« Reply #2 on: March 29, 2016, 01:38:56 AM »

Just call 'addClass' method to add a class to the dialog.


This way I add a class to the  inner box, that is the body of my dialog, but it's not what I need: I'd like to add a class to the outer, the window itself.

My goal is: to set the max-width and max-height of the whole dialog, because I don't know how much text my dialog will contain, so I  want the dialog growth automatically (according to the amount of content), but not too much.

Is there another way to achieve this?


RIc
Logged
jarry
Administrator
Hero Member
*****
Posts: 2303


View Profile Email
« Reply #3 on: March 30, 2016, 01:44:26 AM »

To limit the max height of a dialog, just set the 'maxHeight' property value for it.
Code:
$('#dlg').dialog({
maxHeight: 200,
height: 'auto'
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!