zoukankan      html  css  js  c++  java
  • jquery-easyui combobox combogrid 级联不可编辑实例

    jquery-easyui combobox combogrid 级联不可编辑实例

    如何让jquery-easyui的combobox像select那样不可编辑?
    为combobox添加editable属性 设置为false
    $('#goods_series').combobox({
    url:"xxx/getBrandsGoodsSeries"+"?goods_brand_id="+goodsbrand,
    valueField:'goods_series',
    textField:'goods_series',
    editable:false
    });
    获取值:
    'goods_series':$("#goods_series").combobox("getValue"),
    表单:
    <input class="easyui-combobox" type="text" id="goods_series" style="border:solid 1px #95b8e7;120px;height:23px;" />

    通过combogrid 选择级联的方式加载内容:
    function goodsbrandSelect(){
    var goodsbrand = -1;
    var brandgrid = $('#goodsbrand').combogrid('grid').datagrid('getSelected');
    if (brandgrid != null) {
    goodsbrand = brandgrid.goods_brand_id;
    }
    $('#goods_series').combobox({
    url:"xxx/getBrandsGoodsSeries"+"?goods_brand_id="+goodsbrand,
    valueField:'goods_series',
    textField:'goods_series',
    editable:false
    });
    }

    后台thinkphp代码:
    public function getBrandsGoodsSeries(){
    $goods_brand_id = I('get.goods_brand_id', -1);
    $result = array();
    $goods = M('goods')->field('goods_id, goods_series')
    ->where(array('goods_brand_id'=>$goods_brand_id))->where("goods_series is not null")
    ->group("goods_series")->select();

    if (!empty($goods)){
    $result = $goods;
    }
    echo json_encode($result);
    }

  • 相关阅读:
    IO模型
    Redis的cluster模式
    #4789. 啊孤独感放辣椒
    #4754. 旅途
    #3189. 八纵八横(c)
    洛谷P2624 [HNOI2008]明明的烦恼
    CF938G Shortest Path Queries
    [CTSC2010]珠宝商
    洛谷P1903 [国家集训队]数颜色 / 维护队列
    AtCoder3611 Tree MST
  • 原文地址:https://www.cnblogs.com/zdz8207/p/jquery-easyui-combobox-combogrid.html
Copyright © 2011-2022 走看看