Dojo CheckedMultiSelect text wrap and horizontal scrolling

为君一笑 提交于 2019-12-25 03:27:05

问题


How to make DOJO CheckedMultiSelect text wrapped and how to enable horizontal scrolling in the same control, if the select text is larger that the control size


回答1:


All you need is to overwrite CSS rules. See working example at jsFiddle: http://jsfiddle.net/phusick/qrSWu/

For both of your needs you need to limit the width of dojox/form/CheckedMultiSelect. It can be done adding narrow class to the markup <select data-dojo-type="dojox/form/CheckedMultiSelect" class="narrow"> or JavaScript (via className):

.narrow .dojoxCheckedMultiSelectWrapper {
    width: 100px;
}

For horizontal scrolling add also scroll class (class="narrow scroll"):

.scroll .dojoxCheckedMultiSelectWrapper {
    overflow-x: scroll;
}

For wrapping the option text add wrap class (class="narrow wrap"):

.wrap .dojoxMultiSelectItemLabel {
    white-space: normal;
}

.wrap .dojoxMultiSelectItemBox {
    vertical-align: top;
    margin-top: 3px;
}

Depending on the order you include stylesheets you may need to add !important.



来源:https://stackoverflow.com/questions/12673582/dojo-checkedmultiselect-text-wrap-and-horizontal-scrolling

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!