zoukankan      html  css  js  c++  java
  • combogrid change check multiple

    this.SetDict = function (obj, dicType, multiple, Ischeckbox, callback, change) {
    obj.combogrid({
    panelWidth: 250,
    idField: 'Code',
    textField: 'Name',
    url: '/Common/EntityJsonList.ashx?_method=dict&dictType=' + dicType + "&tmp=" + Math.random() + '&queryTextFild=Name',
    method: 'get',
    delay: 1000,
    columns: [[
    { field: 'Name', title: '名称', 100 },
    { field: 'Code', title: '编码', 100 }
    ]],
    striped: true,
    editable: true,
    collapsible: false, //是否可折叠的
    fit: true, //自动大小
    keyHandler: {
    up: function () { //【向上键】押下处理
    //取得选中行
    var selected = obj.combogrid('grid').datagrid('getSelected');
    if (selected) {
    //取得选中行的rowIndex
    var index = obj.combogrid('grid').datagrid('getRowIndex', selected);
    //向上移动到第一行为止
    if (index > 0) {
    obj.combogrid('grid').datagrid('selectRow', index - 1);
    }
    } else {
    var rows = obj.combogrid('grid').datagrid('getRows');
    obj.combogrid('grid').datagrid('selectRow', rows.length - 1);
    }
    },
    down: function () { //【向下键】押下处理
    //取得选中行
    var selected = obj.combogrid('grid').datagrid('getSelected');
    if (selected) {
    //取得选中行的rowIndex
    var index = obj.combogrid('grid').datagrid('getRowIndex', selected);
    //向下移动到当页最后一行为止
    if (index < obj.combogrid('grid').datagrid('getData').rows.length - 1) {
    obj.combogrid('grid').datagrid('selectRow', index + 1);
    }
    } else {
    obj.combogrid('grid').datagrid('selectRow', 0);
    }
    },
    enter: function () { //【回车键】押下处理
    obj.combogrid('hidePanel');
    },
    query: function (keyword) { //【动态搜索】处理
    //设置查询参数
    var queryParams = obj.combogrid("grid").datagrid('options').queryParams;
    queryParams.keyword = keyword;
    obj.combogrid("grid").datagrid('options').queryParams = queryParams;
    //重新加载
    obj.combogrid("grid").datagrid("reload");

    obj.combogrid("setValue", keyword);
    }
    },
    mode: 'remote',
    fitColumns: true,
    multiple: multiple,
    checkbox: Ischeckbox,
    onLoadSuccess: function () {
    if (callback) {
    callback();
    }
    },
    onChange: function (value, index, data) {
    if (change) {
    change(value, index, data);
    }
    }
    });
    }

  • 相关阅读:
    用struct定义函数
    三、OCTAVE画图
    二、OCTAVE 移动数据
    SQL复习
    Flink处理迟到的数据
    LeetCode题目学习
    CentOS7安装pycharm
    IntelliJ IDEA 刷题利器 LeetCode 插件
    Redis命令学习
    项目杂记
  • 原文地址:https://www.cnblogs.com/kexb/p/5172398.html
Copyright © 2011-2022 走看看