ligerUI---下拉框(Combobox),ligerui---combobox

來源:互聯網
上載者:User

ligerUI---下拉框(Combobox),ligerui---combobox

寫在前面:

  突然發現,從剛開始對ligerUI的抵觸,覺得都沒有接觸過,也不會,到現在,感覺ligerUI的一些組件還是挺好用的,大概日久生情吧。嘻嘻~~~,下拉框是常用的一個組件,在之前的部落格中也寫到了ligerForm中的下拉框,這裡還是再單獨寫一下Combobox下拉框吧。當做筆記嘍~~~~。。。。。

 

  前台頁面代碼:

<script type="text/javascript">    var sysSearchSelect;    $(function() {        //系統選擇下拉框       sysSearchSelect = $("#sysSearchSelect").ligerComboBox({               url: '${baseURL}/getSystemByAll.action',               valueField:'systemId', //下拉框中選項值的id               textField:'systemName', //下拉框中選項值               //initValue:2, 預設選中systemId為2的systemName        });    });</script><body>    <div position="left" title="角色">        <div id="searchbar" class="l-searchbar">            <div>背景action:

private JSONArray arrSystem;    public JSONArray getArrSystem() {        return arrSystem;    }    public String getSystemByAll()throws Exception{        try {            List<System> systemList = systemService.getAll(System.class);            arrSystem = new JSONArray();            for(System sys:systemList){                JSONObject obj = new JSONObject();                obj.put("systemId",sys.getSystemId());                obj.put("systemName",sys.getSystemName());                arrSystem.add(obj);            }        } catch (Exception e) {            throw new BusinessException("查詢getSystemByAll出錯");        }        return "getSystemByAll";    }

下拉框還是比較簡單的,後台只要傳遞前台頁面需要的兩個欄位systemId,與systemName就可以了。前台能接收背景json格式的資料需要做一些處理 ,除了提供對應的get方法

外,在struts.xml檔案中還需要做一下配置,具體的配置,可以參看上幾篇部落格(ligerGrid以及ligerForm中的下拉框),這裡就不再做重複講述了。

 

成功:好累好累好累。。。。。。。。。。我覺得我現在很疲乏。。。。。。。。。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.