简体   繁体   中英

How do I resize p:pickList when p:dialog is resized?

I have a PF4 p:dialog containing ap:pickList.

When I resize p:dialog, it does not resize p:picklist

How do can I do this?

在此处输入图片说明

在此处输入图片说明

The <p:pickList> renders basically a HTML <table> like below:

<table class="ui-picklist">
    <td><ul class="ui-picklist-list">[left list]</ul></td>
    <td>[buttons]</td>
    <td><ul class="ui-picklist-list">[right list]</ul></td>
</table>

In the default PrimeFaces CSS, the .ui-picklist-list has a fixed width of 200px .

在此处输入图片说明

We'd like to make this the minimum-width instead and make the table cells containing the left and right lists expand to their maximum (50% is OK).

All in all, just adding those CSS rules to the stylesheet file which is loaded after the PrimeFaces CSS should suffice.

.ui-picklist td:first-child,
.ui-picklist td:last-child {
    width: 50%;
}
.ui-picklist .ui-picklist-list {
    width: auto;
    min-width: 200px;
}

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM