我可以通过javascript更改devexpress日期编辑设置吗?
问题描述:
在项目中,我有一个DateEdit显示带有日历:我可以通过javascript更改devexpress日期编辑设置吗?
pickerGroup.Items.Add(item => Model.Start, itemSettings =>
{
itemSettings.NestedExtensionType = FormLayoutNestedExtensionItemType.DateEdit;
var dateEditSettings = (DateEditSettings)itemSettings.NestedExtensionSettings;
dateEditSettings.Properties.CalendarProperties.Columns = 2;
dateEditSettings.Properties.CalendarProperties.Rows = 1;
});
我的目标是,如果窗口宽度是< XX
我是在一个javascript函数思想为改变这2个属性:
function Responsive() {
var width = screen.width;
if (width < 1000) {
settings.Properties.CalendarProperties.Columns = 1;
settings.Properties.CalendarProperties.Rows = 2;
}
else {
}
}
这可能吗?任何帮助都会大大降低。
谢谢
答
我可以用DevExpress的研究与开发团队联系,并回答我的问题,不,这是不可能的。
他们的答案:
DateEdit does not provide the capability to change the Columns property on the client side. As a workaround I suggest you use @media CSS rules. For example:
@@media screen and (max-width: 1000px) {
.dxeCalendar_DevEx td {
display: block;
}
.dxeCalendar_DevEx td td {
display: table-cell;
}
}
Note that it is necessary to set the current theme name instead of the "_DevEx" postfix. Should you have any further questions, feel free to contact us.