Jump to content

Set width to multiSelect


Go to solution Solved by denno020,

Recommended Posts

  Hello,
Please open http://ec2-34-212-140-26.us-west-2.compute.amazonaws.com/admin/product/edit?id=61&debug=9
page. Login must be visible on login page. Just click “Login”.
Popup dialog with multiSelect is opened with code like:
 

$('#multi_categories_list').multiSelect( {
multiple: false,
header: "Type",
noneSelectedText: "Type",
selectedList: 1,
minWidth:1000,

} );

$("#multi_categories_list").multiSelect('refresh');
$("#multi_categories_list").focus()
$("#multi_categories_list").css('width', '1000px');
$("#multi_categories_list").width(1000);


if ( parseInt(this_debug) == 9 ) {
alert( "INITED::" )
}

I try to set more width in ways I found in google, but failed.
Which is the right way?

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/304424-set-width-to-multiselect/
Share on other sites

  • Solution

Is there a reason you're using JS to set the width and not CSS?

 

It looks like you're targeting the <select> element, but due to the use of some multi-select plugin, the <select> element is actually hidden and will be updated automatically by the plugins' Javascript when you select one of the multi-select items (which are actually just rendered as <li>'s)

 

Try targeting the element "#ms-multi_categories_list" when setting the width, and you should see things change.

$("#ms-multi_categories_list").css('width', '1000px');

Ideally, however, you would add this width information to your stylesheet

 

Denno

Edited by denno020
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.