none
AutoCompleteExtender 内容显示位置 RRS feed

  • 问题

  • 我在GridView中用了Ajax AutoCompleteExtender  的自动提示,开始没什么问题,但是当GridView中的数据增加后。页面的的高度也增加。当加到有滚动条的时候AutoCompleteExtender  显示的内容并没有随着数据的增加而改变。在ScriptAction中要怎么获取txtWire1的offsetHeight,offsetLeft... 求解
     <ajaxToolkit:AutoCompleteExtender
    runat="server"
    BehaviorID="AutoCompleteEx25"
    ID="AutoCompleteExtender25"
    TargetControlID="txtWire1"
    ServicePath="AutoComplete.asmx"
    ServiceMethod="GetSearchItems1"
    MinimumPrefixLength="1"
    CompletionSetCount="20"
    CompletionListCssClass="autocomplete_completionListElement"
    CompletionListItemCssClass="autocomplete_listItem"
    CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
    DelimiterCharacters=";, :" >
    <Animations>
    <OnShow>
    <Sequence>
    <OpacityAction Opacity="0" />
    <HideAction Visible="true" />
    <ScriptAction Script="
    // Cache the size and setup the initial size
    var behavior = $find('AutoCompleteEx25');
    if (!behavior._height) {
    var target = behavior.get_completionList();
    behavior._height = target.offsetHeight - 2;
    target.style.height = '0px';
    target.style.backgroundColor='#f8d291';

    }" />
    <Parallel Duration=".4">
    <FadeIn />
    <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx25')._height" />
    </Parallel>
    </Sequence>
    </OnShow>
    <OnHide>
    <Parallel Duration=".4">
    <FadeOut />
    <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx25')._height" EndValue="0" />
    </Parallel>
    </OnHide>
    </Animations>
    </ajaxToolkit:AutoCompleteExtender>   
    2010年11月23日 6:11

全部回复