I'm using JQuery-Ui in my crm 2011 application. I use jquery-ui-dialog to diaplay a list, but when the list is too long I want a vertical scroll bar to appear. now the list exceeds the length of the form. I tried setting the dialog's max-height, but nothing happened - perhaps I didn't do it the right way.. (I'm new to jquery and css). I would appreciate any help, Thanks!
var listItemsString = "";
for (var i = 0; i < listItemsArray.length; i++) {
listItemsString += "<li class='ui-widget-content'>" + listItemsArray[i] + "</li>";
}
var div = $("<div id='myListDialog' title='this is the title'><p class='validateTips'>this is the description</p>"
+ "<form><ul id='selectable'>" + listItemsString + "</ul></form></div>");
$("body").prepend(div);
$("#selectable ul").css({ "list-style-type": "none", "margin": "0", "padding": "0", "width": "60%" });
$("#selectable li").css({ "margin": "3px", "padding": "0.4em", "height": "14px" });
$("#selectable").selectable({ selected: listSelectfunction ,unselected: listUnselectfunction});
$("#myListDialog").dialog({
height: 20,
modal: true,
autoOpen: true,
draggable: false,
resizable: false,
position: [350, $(window.parent.document).scrollTop() + 500 / 2],
closeOnEscape: false,
open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); },
buttons: buttons
});