How to use umbraco datetime property editor
When I was using Umbraco datetime property editor, I met with a problem that the editor must be first time initialized with value, if I want to change the value later after the control is rendered, I have to use javascript.
Below pasted the code.
editor part:
<umb-property property="ExpiryDate">
<umb-editor model="ExpiryDate"></umb-editor>
</umb-property>
the controller initialization part:
function buildDateTimePickerModel(alias, label, description, value) {
return {
editor: "Umbraco.DateTime",
label: label,
description: description,
hideLabel: false,
view: "datepicker",
alias: alias,
value: value,
validation: {
mandatory: false,
pattern: ""
},
config: {
dateFormat: "YYYY-MM-DD HH:mm:ss",
pickDate: true,
pickTime: true,
useSeconds: true
}
};
};
$scope.ExpiryDate = buildDateTimePickerModel('ExpiryDate', 'ExpiryDate', 'Enter the ExpiryDate', null);
so, this code will guarantee that at least you can see the control as soon as it is loaded, but, you can see, what if I have a asynchonous model that I need to apply to this control later? my current solution is to find the control by its id, and then apply value to it with formatters, all these stuffs are actually wrapped in an angular js controller, so, the setter method of the control would be:
$('#ExpiryDate').val($filter('date')($scope.CouponCode.ExpiryDate, 'yyyy-MM-dd hh:mm:ss'));
anywhere!
How to use umbraco datetime property editor的更多相关文章
- XAF-如何修改内置的编辑器(Property Editor)
本示例演示在web/win中给 日期选择控制显示出一个时钟及修改时间的控件.效果如下: 如果你装了XAF在这个路径中已经有了这个示例: %PUBLIC%\Documents\DevExpress De ...
- XAF Spreadsheet property Editor
https://www.devexpress.com/Support/Center/Question/Details/T371232
- 第15.11节 PyQt(Python+Qt)入门学习:Qt Designer(设计师)组件Property Editor(属性编辑)界面中主窗口QMainWindow类相关属性详解
概述 主窗口对象是在新建窗口对象时,选择main window类型的模板时创建的窗口对象,如图: 在属性编辑界面中,主窗口对象与QMainWindow相关的属性包括:iconSize.toolButt ...
- Format a Property Value 设置属性值的格式
In this lesson, you will learn how to set a display format and an edit mask to a business class prop ...
- [翻译] Writing Property Editors 编写属性编辑器
Writing Property Editors 编写属性编辑器 When you select a component in the designer its properties are di ...
- How to: Specify a Display Member (for a Lookup Editor, Detail Form Caption, etc.)如何:指定显示成员(用于查找编辑器、详细信息表单标题等)
Each business object used in an XAF application should have a default property. The default property ...
- Make a Property Calculable 使属性可计算
In this lesson, you will learn how to manage calculated properties. For this purpose, the Payment cl ...
- Add an Editor to a Detail View 将编辑器添加到详细信息视图
In this lesson, you will learn how to add an editor to a Detail View. For this purpose, the Departme ...
- Access Editor Settings 访问编辑器设置
This topic demonstrates how to access editors in a Detail View using a View Controller. This Control ...
随机推荐
- java.lang.NoClassDefFoundError:
异常信息:十一月 10, 2016 5:20:15 下午 org.apache.catalina.core.StandardContext loadOnStartup严重: Servlet /mgr ...
- Hibernate学习笔记4
一.关于联合主键的映射测试实例 实体类: package com.***.comBineKey;public class Person { private Person_pk pk; private ...
- sphinx通过增量索引实现近实时更新
一.sphinx增量索引实现近实时更新设置 数据库中的已有数据很大,又不断有新数据加入到数据库中,也希望能够检索到.全部重新建立索引很消耗资源,因为我们需要更新的数据相比较而言很少. 例如.原来的数据 ...
- *HDU2510 DFS
符号三角形 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submi ...
- 在ubuntu 12.04 x64下编译hadoop2.4
自己编译hadoop:x64 1.安装依赖包 sudo apt-get install g++ autoconf automake libtool cmake zlib1g-dev pkg-confi ...
- Android-adb指令
adb概念: adb的全称为Android Debug Bridge(调试桥):通过adb我们可以在Eclipse中方便通过DDMS来调试Android程序.当我们运行Eclipse时ADB进程 ...
- 最难面试的IT公司之ThoughtWorks代码挑战——FizzBuzzWhizz游戏
最近互联网招聘平台拉勾网在五一期间推出个“最难面试的IT公司”代码挑战活动,评选出了5个最难面试的IT公司,即:ThoughtWorks.Google.Unisys.Rackspace.Cypress ...
- linux 源码安装详解
./configure是用来检测你的安装平台的目标特征的.比如它会检测你是不是有CC或GCC,并不是需要CC或GCC,它是个shell脚本.make是用来编译的,它从Makefile中读取指令,然后编 ...
- ComboSelect 下拉筛选
Jquery Combo Select下拉筛选 http://www.dowebok.com/179.html
- [转载] Win PE内安装Windows 7原版镜像 / 安装程序无法创建新的系统分区,也无法定位现有的系统分区
格式化C盘为NTFS格式 解压ISO安装文件中找到BOOT.BOOTMGR和SOURCES这三个文件到C盘根目录下:或者复制BOOT.BOOTMGR,在C盘新建文件夹SOURCES,复制ISO安装文件 ...