I have a list which I use the SPCascadeDropdowns to very good effect. I have a field "Predecessors" that is dependent on the content of the "Project" field.
When the new form is displayed, "Project" is empty, and therefore the Predecessors multi-select field is empty too. This makes the bottom scroll bar disabled. When a Project is selected, the Predecessors field gets populated, but the bottom scroll
bar remains disabled. I have been able to add the SPSetMultiSelectSizes function to the "completefunc" property, and the multi-select field now sizes itself to the content of the field. However, because the multi-select field starts empty,
the SPSetMultiSelectSizes function makes the left and right select boxes in the field very narrow.
Would it be possible to extend this function to have a minWidth and a MaxWidth property (pixels)? If the text is longer than MaxWidth, then the bottom scroll bar should be enabled. If the text is shorter than minWidth, then the bottom scroll bar can be disabled.
[goes away, scratches his head, thinks for a bit, tries some code changes out, and then comes back to this post...]
it worked. Below is an extract from this file, my new code marked in bold.
// We'll add 5px for a little padding on the right.
var divWidth = $("#" + cloneId).width() + 5;
var newDivWidth = divWidth;
if(divWidth < 100) divWidth = 100;
if(newDivWidth < 100) newDivWidth = 100;
if(newDivWidth > 200) newDivWidth = 200;
// Subtract 17 from divWidth to allow for the scrollbar for the select
var selectWidth = divWidth - 17;
// Set the new widths
possibleValues.css("width", selectWidth + "px").parent().css("width", newDivWidth + "px");
selectedValues.css("width", selectWidth + "px").parent().css("width", newDivWidth + "px");
The result: then the new form is shown, the multi-select is 100px wide and empty. When the Project is selected, the values are filled in, and they scroll left/right (and is shown 200px wide). When a Project is selected which shows no values in the Predecessor
multi-select, it is shown 100px. When a Project is selected which shows short values in the Predecessor multi-select, it is shown 100px.
Hope that's helpful and that the parameters / properties can be added easily...