gpt4 book ai didi

javascript - Datetimepicker 日历未在正确的位置打开

转载 作者:太空宇宙 更新时间:2023-11-04 12:03:02 27 4
gpt4 key购买 nike

Bootstrap datetimepicker 日历在网格外打开。它没有在正确的位置打开。请看看 fiddle ,告诉我该怎么做。我希望日历在正确的位置打开,如果需要,日历也可能在网格外可见。我不会在任何时候隐藏日历。请帮我做这件事

http://jsfiddle.net/rtzxsa3e/11/

$(function () {
var data = [

{ rank: 1, company: 'Exxon Mobil', DatePicker: '04/04/1990 00:00', revenues: '339938.0', profits: '36130.0' },

{ rank: 2, company: 'Wal-Mart Stores', DatePicker: '05/03/2014 00:00', revenues: '315654.0', profits: '11231.0' },
{ rank: 1, company: 'Exxon Mobil', DatePicker: '04/04/1990 00:00', revenues: '339938.0', profits: '36130.0' },

{ rank: 2, company: 'Wal-Mart Stores', DatePicker: '05/03/2014 00:00', revenues: '315654.0', profits: '11231.0' },
{ rank: 1, company: 'Exxon Mobil', DatePicker: '04/04/1990 00:00', revenues: '339938.0', profits: '36130.0' },

{ rank: 2, company: 'Wal-Mart Stores', DatePicker: '05/03/2014 00:00', revenues: '315654.0', profits: '11231.0' },
{ rank: 1, company: 'Exxon Mobil', DatePicker: '04/04/1990 00:00', revenues: '339938.0', profits: '36130.0' },

{ rank: 2, company: 'Wal-Mart Stores', DatePicker: '05/03/2014 00:00', revenues: '315654.0', profits: '11231.0' },
];
var obj = {
height:300,
title: "ParamQuery Grid with JSON Data",
scrollModel:{autoFit:true, theme:true}
};

obj.colModel = [

{ title: "Rank", width: 100, dataType: "integer", dataIndx: "rank" },
{ title: "Company", width: 200, dataType: "string", dataIndx: "company" },
{ title: "DatePicker", width: 200, dataType: "string", dataIndx: "date",editable:false,
render : function(){
var date = '<div class="form-group" style="width:150px;text-align:center"><div class="input-group date" id="datetimepicker123"><input type="text" value="04/05/2012 00:00" class="form-control"><span class="input-group-addon"><span class="glyphicon-calendar glyphicon"></span></span></div></div>';

return date;
}
},
{ title: "Revenues ($ millions)", width: 150, dataType: "float", align: "right", dataIndx: "revenues" },
];

$('body').on('mouseover','.input-group',function() {

$(".input-group.date").datetimepicker();

});

obj.dataModel = { data: data };

$("#grid_json").pqGrid(obj);
});

span.input-group-addon {
width: 27px;
}
.pq-grid td.pq-grid-cell{overflow:visible}
<div id="grid_json" style="margin:100px;"></div>

.

最佳答案

Hochas 是对的,这是因为您的样式会影响 Bootstrap 中的样式。要覆盖它们并将日期选择器保留在表格单元格中,您可以应用这些 CSS 样式:

.form-group {
margin-left: 0px !important;
width: 100% !important;
}

关于javascript - Datetimepicker 日历未在正确的位置打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29598682/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com