Struts2的jQuery插件Autocompleter部件尺寸 [英] Struts2 jQuery plugin Autocompleter widget size

查看:241
本文介绍了Struts2的jQuery插件Autocompleter部件尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是用从Struts2的jQuery插件的autocompleter部件。我试着从展示项目来改变选择框的大小

I was using an autocompleter widget from Struts2 jQuery plugin. I tried the code from the showcase project to change the size of the select box:

<strong>Result Div :</strong>
<div id="formResult" class="result ui-widget-content ui-corner-all">Submit form bellow.</div>
<strong>Topics Div :</strong>
<div id="topics" class="result ui-widget-content ui-corner-all"></div>
<s:form id="form" action="echo" theme="simple" cssClass="yform">
    <fieldset>
        <legend>Select Box as Autocompleter</legend>
        <div class="type-select">
            <label for="echo">Echo: </label>
            <sj:autocompleter
                    id="customers"
                    name="echo"
                    list="%{customers}"
                    listValue="name"
                    listKey="id"
                    selectBox="true"
                    selectBoxIcon="true"
                    onChangeTopics="autocompleteChange"
                    onFocusTopics="autocompleteFocus"
                    onSelectTopics="autocompleteSelect"
                    cssStyle="width:100%;"
                    />
        </div>
        <div>
            <sj:submit
                    targets="formResult"
                    value="AJAX Submit"
                    indicator="indicator"
                    button="true"
                    />
            <img id="indicator" src="images/indicator.gif" alt="Loading..." style="display:none"/>
        </div>
    </fieldset>
</s:form>

<br/>

但没有运气,如何改变选择框的大小,以适合容器的宽度是多少?我也试图通过改变尺寸尺寸 HTML属性,但它改变不了什么。

but with no luck, how to change the size of the select box to fit the width of the container? I also tried to change the size via size HTML attribute, but it changes nothing.

推荐答案

看着生成的HTML既不 cssStyle 也不的CssClass &LT的;律政司司长:autocompleter&GT; 标记设置为实际输入字段。但是你可以使用纯CSS样式此输入。把你的&LT; SJ:autocompleter&GT; 一些元素中只改变特定的输入,那么你可以使用这样的事情:

Looking at generated HTML neither cssStyle nor cssClass of <sj:autocompleter> tag is set to actual input field. But you can use plain CSS to style this input. Put your <sj:autocompleter> inside of some element to change only specific input then you can use something like that:

.type-select .s2j-combobox-input {
  width: 100%;
}

其中,键入选是一流的包装元素和 S2J-组合框中输入是类生成输入现场的&LT; SJ:autocompleter&GT;

Where type-select is class of wrapper element and s2j-combobox-input is the class of generated input field for the <sj:autocompleter>.

这篇关于Struts2的jQuery插件Autocompleter部件尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆