Atitit.auto complete 自動完成控制項的實現總結,autocomplete

來源:互聯網
上載者:User

Atitit.auto complete 自動完成控制項的實現總結,autocomplete

Atitit.auto complete  自動完成控制項的實現總結

 

1. 架構選型 1

2. 自動完成控制項的ioc設定 1

3. Liger  自動完成控制項問題 1

4. 官網上的code有問題,不能顯示控制項渲染,,查看源碼  <input type="text" id="txt2" onchange="changeEventO9()"/>這個簡化版本的走ok蘭... 1

5. Liger  自動完成控制項的調用 2

6. -------------------autoKmpltSpt---------- 2

 

1. 架構選型

Easyui 馬,,,jqeueryui 好像有了,三,走十不的上K,好像gfw蘭...

..子好..Ligerui..liger的文檔有點兒爛,也不是弄全...

 

2. 自動完成控制項的ioc設定

autoKmpltUrl="../common/ajaxSvs.jsp?meth=mtr4autoKmplt";

AKVfld="materialId";

AKTfld="materialDescription"

 

3. Liger  自動完成控制項問題

官網上的code有問題,不能顯示控制項渲染,,查看源碼  <input type="text" id="txt2" onchange="changeEventO9()"/>這個簡化版本的走ok蘭...

子能url,不能dwr執行在不個data分配給ac控制項...

Id文字框子能使用預設的...林吧只好添加個textChange事件copy過去...

 

 

作者:: 老哇的爪子 Attilax 艾龍,  EMAIL:1466519819@qq.com

轉載請註明來源: http://blog.csdn.net/attilax

 

4. Liger  自動完成控制項的調用

                           <!-- mtr query control start--> 

                

   <script>

autoKmpltUrl="../common/ajaxSvs.jsp?meth=mtr4autoKmplt";

AKVfld="materialId";

AKTfld="materialDescription"

 </script>

    <%@include file="../playcount/autoKmpltSpt.html" %>            

                                                        

<!--  def data fmt

[{"id":0,"name":"a0cname","desc":"0desc"}

-->

  <input type="text" id="txt2" onchange="changeEventO9()"/>

  <script>

  function changeEventO9( )

  {

  $("#materialId").val($("#txt2_val").val());

  }

  </script>

<!--///-->

                          

     <input name="materialId" type="text" id="materialId" value="" size="3" style="display:none"/>

 <!-- mtr query control end--> 

 

5. -------------------autoKmpltSpt----------

 

<link href="../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css">

<style type="text/css"></style>

 

<script src="../lib/ligerUI/js/core/base.js" type="text/javascript"></script>

<script src="../lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>

<script src="../lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>

<script src="../lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>

<script type="text/javascript" defer="defer">

        $(function ()

        {

            var columns = [

                { header: 'ID', name: 'id', width: 80 },

                { header: '名字', name: 'name', width: 170 },

                { header: '描述', name: 'desc', width: 170 }

            ];

 

         /*   $("#txt1").ligerComboBox(

                {

                    url: '../../data/net/ComboBoxData.ashx',

                    valueField : 'id',

                    textField: 'name',

                    columns: columns,

                    selectBoxWidth: 400,

                    autocomplete: true,

                    width: 400

                }

            );*/

// alert(autoKmpltUrl);

            $("#txt2").ligerComboBox(

                {

                    url: autoKmpltUrl,

                    valueField: AKVfld,

                    textField: AKTfld,

                    selectBoxWidth: 200,

                    autocomplete: true,

                    width: 200

                }

            );

 

 

           // $("#txt3").ligerComboBox(

//                {

//                    url: '../../data/net/ComboBoxData.ashx',

//                    valueField: 'id',

//                    textField: 'name',

//                    selectBoxWidth: 200,

//                    autocomplete: true,

//                    width: 200,

//                    renderItem: function (e)

//                    {

//                        var data = e.data, key = e.key;

//                        var out = [];

//                        out.push('<div>' + this._highLight(data.name, key) + '</div>');

//                        out.push('<div class="desc">備忘:' + data.desc + '</div>');

//                        return out.join('');

//                    }

//                }

//            );

        });

          

    </script>

<style type="text/css">

.desc {

background: #fafafa;

color: ActiveCaption;

border-bottom: 1px solid #d3d3d3;

margin-top: 3px;

margin-bottom: 3px;

}

.l-over .desc, .l-selected .desc {

background: none;

}

</style>

 

 

 

 


AutoCompleteExtender自動完成控制項,在給裝填資料時怎填兩個值?

這個東西就是為一個值設計的,如果想要雙值的話還是用非同步取吧。
 
助AutoCompleteExtender控制項

不同版本的autocomplete控制項的功能不一樣,不知道你用的是什麼版本的,建議你去下個最新的
有的版本有這幾個屬性可以設定樣式
CompletionListCssClass="提示列表的樣式"
CompletionListItemCssClass="未選擇項的樣式"
CompletionListHighlightedItemCssClass="選擇項的樣式"
這就可以完成你想要的效果了
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.