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

  • 相关阅读:
    使用opencv显示视频的方法
    使用visual studio 2012 编译opencv2.4.9
    求前100个斐波那契数
    EXTJs前后台交互 常用哦3种方式
    spring 注解
    程序 人生
    ajaxs
    LNMP源码安装脚本
    系统状态统计和查看
    Shell中的${}、##和%%使用范例
  • 原文地址:https://www.cnblogs.com/zdz8207/p/jquery-easyui-combobox-combogrid.html
Copyright © 2011-2022 走看看