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:就这一行代码,找了我两天,太痛苦了。。

  • 相关阅读:
    Rabbitmq
    Python() with语法糖
    Python()-类的专有方法之双下划线方法
    git配置踩过的坑
    https 协议 和 ssh 协议在使用上的差别
    Definite dimensionality
    java中定义和声明的区别
    数据库中表的数据逻辑删除的方案
    StringBuffer、StringBuilder和String的区别?
    常量池中的String与堆中的String
  • 原文地址:https://www.cnblogs.com/baiyunchen/p/4816549.html
Copyright © 2011-2022 走看看