【问题标题】:YUI autocomplete in datatable is hidden in the cell/CSS-Problem数据表中的 YUI 自动完成隐藏在单元格/CSS 问题中
【发布时间】:2011-06-24 12:45:29
【问题描述】:

我有一个 YUI 数据表,并希望在其中一列中有一个自动完成功能。我让自动完成功能正常工作,但现在我似乎遇到了 CSS 问题。

自动完成隐藏在列的单元格中,我无法选择任何内容,因为我看不到它。我怎样才能让它位于视图的顶部?我尝试打开 z-index,将其设置为 11000,因为我在某处读到 yui 使用 10000,但它仍然无法正常工作。

有什么建议我接下来应该做什么?

我的列格式化程序

var suggestFormatter = function(elCell, oRecord, oColumn, oData){
    var id = oRecord.getData('questionId');
    var html = '<div id="suggest" style="position:static;z-index:11111;">';
    html+= '<input id="category_suggest'+id+'" onfocus="initSuggest(\''+id+'\')" type="text" style="position:static;">';
    html+= '<div id="category_suggest_container'+id+'" style="width:150px;position:static;"></div>';
    html+= '</div>';
    html+= '<input type="hidden" id="categoryId'+id+'" name="categoryId"/>';
    elCell.innerHTML = html;    
};

【问题讨论】:

  • 可以把渲染出来的HTML放到jsfiddle里吗?
  • 您使用位置是否有原因:静态而不是相对或绝对?

标签: css autocomplete datatable yui


【解决方案1】:

你确定你想要的是 position:static 吗?尝试使用相对或绝对。阅读更多关于定位的信息here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-24
    • 1970-01-01
    • 1970-01-01
    • 2019-08-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多