【问题标题】:Can I change devexpress date edit settings through javascript?我可以通过 javascript 更改 devexpress 日期编辑设置吗?
【发布时间】:2017-04-21 08:26:24
【问题描述】:

在我的项目中,我有一个显示日历的 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;
});

如果窗口宽度为 ,我的目标是更改这两个属性

我在想一个 javascript 函数:

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

    }
}

有可能吗?任何帮助将不胜感激。

谢谢

【问题讨论】:

    标签: javascript devexpress devexpress-mvc


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-04
      • 2012-08-29
      • 1970-01-01
      • 2019-10-19
      • 2021-09-30
      • 2017-01-06
      • 2013-02-16
      • 2021-10-20
      相关资源
      最近更新 更多