2017-08-24 23 views
1

我在我的slickgrid中添加了mcautocomplete。如果我检查一些复选框,mcautocomplete表格在slickgrid上不再可见。请检查图片。 我如何确保我的自动填充选项在我的滑动网格上可见?mcautocomplete在slickgrid上消失

enter image description here

 $.widget('custom.mcautocomplete', $.ui.autocomplete, { 
    _create: function() { 
     this._super(); 
     this.widget().menu("option", "items", "> :not(.ui-widget-header)"); 
    }, 
    _renderMenu: function (ul, items) { 
     var self = this, 
      thead; 
     if (this.options.showHeader) { 
      table = $('<div class="ui-widget-header" style="width:100%"></div>'); 
      $.each(this.options.columns, function (index, item) { 
       table.append('<span style="font-weight:bold;background-color:#EEE8AA;padding:0 4px;float:left;width:' + item.width + ';">' + item.name + '</span>'); 
      }); 
      table.append('<div style="clear: both;"></div>'); 
      ul.append(table); 
     } 
     $.each(items, function (index, item) { 
      self._renderItem(ul, item); 
     }); 
    }, 
    _renderItem: function (ul, item) { 
     var t = '', 
      result = ''; 
     $.each(this.options.columns, function (index, column) { 
      t += '<span style="background-color:#ADD8E6;padding:0 4px;float:left;width:' + column.width + ';">' + item[column.valueField ? column.valueField : index] + '</span>' 
     }); 
     result = $('<div></div>') 
      .data('ui-autocomplete-item', item) 
      .append('<div class="mcacAnchor">' + t + '<div style="clear: both;"></div></div>') 
      .appendTo(ul); 
     return result; 
    } 
}); 

回答

1

您可以尝试的z-index(这可以是复杂的,一切都归结到容器中的元素的优先级),但我发现,一些JavaScript控件的结构根本就没有与SlickGrid兼容。
(并不是说mcautocomplete不兼容,只要调整正确,但它可能不是)。

例如,我使用'selected'作为下拉菜单,但由于它使用的表格元素不能很好地与slickgrid基础结构配合使用,所以我不得不放弃'select2'。在6pac github存储库中有一个'select2'示例,我认为select2具有自动更正模式。也许值得尝试一下。

+0

我找到了这个例子,它的效果很好。非常感谢你。 http://6pac.github.io/SlickGrid/examples/example-select2-editor.html – Nakres