2017年8月18日 星期五

Datepicker Popup 使用範例

<span class="input-group"><input uib-datepicker-popup="yyyy/MM/dd" ui-mask="9999/99/99" model-view-value="true" is-open="popupInvoice.opened" type='text' class='form-control' ng-model='selectData["憑證日期"]'><span class="input-group-btn"><button type="button" class="btn btn-default" ng-click="popupInvoice.opened=true"><i class="glyphicon glyphicon-calendar"></i></button></span></span>

若容器有設定overflow,日期選擇視窗不要被容器遮住,造成容器出現捲軸,請在 module 加入
.config(['uibDatepickerPopupConfig', function (uibDatepickerPopupConfig) {
            uibDatepickerPopupConfig.appendToBody = true;
        }])

若在 $uibModal 中使用,須設定 z-index 避免被遮住
.uib-datepicker-popup {
    z-index: 1060 !important; /*避免被$uibModal遮住*/
}

讓文字顯示成中文
====
安裝 angular-i18n

沒有留言:

Entity Framework 建立新物件並儲存後馬上取得關聯資料

使用 CreateProxy 建立物件,不要直接 new var newmodel = _contextXXX.CreateProxy<yyy>(); ... _contextXXX.yyy.Add(newmodel); await _contextXXX.SaveC...