https://github.com/mydea/handsontable-chosen-editor

handsontable-chosen-editor是handsontable column的扩展,实现了在handsontable编辑列中下拉列表,同时支持的多选。

使用后发现,屏幕底部的行中,下拉项无法显示,因为下拉项定义的是向下展开,即使下拉项的位置超出了屏幕底部。

修改方法:

chosen.css中添加

.chosen-container.chosen-with-drop-top .chosen-drop {
left: 0;
top:-220px;
}

chosen.jquery.js中的results_show中

把原来的

 this.container.addClass("chosen-with-drop");

改为

var totalheight = $(window).height();
var thistop = $($.find('div.handsontableInputHolder')[0]).offset().top;
if ((parseInt(totalheight) - parseInt(thistop)) < 200)
{
this.container.addClass("chosen-with-drop-top");
}
else
{
this.container.addClass("chosen-with-drop");
}

 在results_hide函数中添加

 this.container.removeClass("chosen-with-drop-top");

这样,当底部空间不足时,下拉列表将向上展开。

 

相关文章:

  • 2021-11-28
  • 2019-07-29
  • 2021-12-27
  • 2021-12-09
  • 2021-11-10
  • 2021-12-11
  • 2021-09-11
猜你喜欢
  • 2018-06-05
  • 2021-12-19
  • 2021-11-15
  • 2021-11-30
  • 2021-12-24
  • 2021-10-05
  • 2018-11-04
  • 2021-11-29
相关资源
相似解决方案