我可以通过javascript更改devexpress日期编辑设置吗?

时间:2017-04-21 08:26:25

标签: javascript devexpress devexpress-mvc

在我的项目中,我有一个DateEdit,显示日历:

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

我的目标是在窗口宽度<1时更改这两个属性。 XX

我在javascript函数中思考:

function Responsive() {
    var width = screen.width;
    if (width < 1000) {
        settings.Properties.CalendarProperties.Columns = 1;
        settings.Properties.CalendarProperties.Rows = 2;
    } 
    else {

    }
}

有可能吗?任何帮助都会大大减少。

谢谢

1 个答案:

答案 0 :(得分:0)

我可以与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.