zoukankan      html  css  js  c++  java
  • 关于ligerui grid 行内编辑 combobox 只能选择的问题

    这个貌似是天然的不支持,修复方案,在ligerGridOrd.js中添加一行代码,如下,跟了一下午的源码,发现在这里的时候,options中只保留了combobox中的一部分属性,所以可能combobox中的很多东西都用不了了。这段代码大约在271行的位置,如果你没有引用ligerGridOrd.js,那就去ligerui.all.js找找看,应该也会有。

    $.ligerDefaults.Grid.editors['select'] =
         $.ligerDefaults.Grid.editors['combobox'] =
         {
             create: function (container, editParm)
             {
                 var column = editParm.column;
                 var input = $("<input type='text'/>");
                 container.append(input);
                 var options = {
                     data: column.editor.data,
                     slide: false,
                     valueField: column.editor.valueField || column.editor.valueColumnName,
                     textField: column.editor.textField || column.editor.displayColumnName,
                     autocomplete: column.autocomplete//修复combobox不支持手动输入的问题
                 };
                 var ext = column.editor.p || column.editor.ext;
                 if (ext)
                 {
                     var tmp = typeof (ext) == 'function' ?
                     ext(editParm.record, editParm.rowindex, editParm.value, column) : ext;
                     $.extend(options, tmp);
                 }
                 input.ligerComboBox(options);
                 return input;
             },
             getValue: function (input, editParm)
             {
                 return input.liger('option', 'value');
             },
             setValue: function (input, value, editParm)
             {
                 input.liger('option', 'value', value);
             },
             resize: function (input, width, height, editParm)
             {
                 input.liger('option', 'width', width);
                 input.liger('option', 'height', height);
             },
             destroy: function (input, editParm)
             {
                 input.liger('destroy');
             }
         };

    ps:就这一行代码,找了我两天,太痛苦了。。

  • 相关阅读:
    [转]: 浅谈Java中的equals和==
    易忘易混的java基本概念
    mysql查看锁表锁进程
    [转] Python 包管理工具解惑
    双网卡单网关的路由问题
    [转]火狐 SSL 收到了一个弱临时 Diffie-Hellman 密钥
    Linux中如何进入减号开头的目录中
    zabbix的一点记录
    从图形界面配置zabbix
    调用API自动配置zabbix version 3.0
  • 原文地址:https://www.cnblogs.com/baiyunchen/p/4816549.html
Copyright © 2011-2022 走看看