• 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);
    }

  • 相关阅读:
    Java Synchronized的用法
    静态方法中不能new内部类的实体对象
    android ViewGroup事件分发机制
    安卓设备通过USB接口读取UVC摄像头权限问题
    android View事件分发机制结论
    函数指针与指针函数以及typedef
    GeoHash
    快速排序,C语言实现
    字符串的几个算法
    ANSI C与GNU C
  • 原文地址:https://www.cnblogs.com/zdz8207/p/jquery-easyui-combobox-combogrid.html
Copyright © 2020-2023  润新知