handsontable-chosen-editor

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");

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

 

转载于:https://www.cnblogs.com/darksied/p/4894560.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值