首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在angular 4中添加和编辑DevExtreme网格时自定义弹出窗口

在angular 4中添加和编辑DevExtreme网格时自定义弹出窗口
EN

Stack Overflow用户
提问于 2017-06-15 14:31:43
回答 0查看 2.9K关注 0票数 0

我是angular 4的新手,我使用过devExtreme网格来显示数据,并使用REST API进行了所有的CRUD操作。我有能力绑定数据到数据网格,但我想自定义的添加和编辑模板弹出,因为有文件上传控制以及查找控制与图像我需要add.Please你能帮助我在这一点上。

代码语言:javascript
复制
import { Component, OnInit } from '@angular/core';
import {DataService} from 'app/app.DataService';
@Component({
  selector: 'app-manage-category',
  templateUrl: './manage-category.component.html',
  styleUrls: ['./manage-category.component.css'],
 providers:[DataService]
})
export class ManageCategoryComponent implements OnInit {
dtCategory: Categories[];
//events: Array<string> = [];
showHeaderFilter: boolean;
showFilterRow: boolean;
title:string;
  constructor(private _dataservice:DataService) {
      this.showHeaderFilter = true;
        this.showFilterRow=true;
 
   }

  ngOnInit() {
  this._dataservice.getCategories().subscribe(categories=>{this.dtCategory=categories});

}
 logEvent(eventName) {
   if(eventName==="InitNewRow")
   {
     
   }
  }
}

interface Categories {     
    CategoryID: number; 
    CategoryIcon: string;
    CreatedBy:string;
    CreatedDate:Date;
    CategoryName:string; 
    IsActive:boolean;
}
代码语言:javascript
复制
<div>
<h3>Manage Category</h3>
<div>
<dx-data-grid 
    id="gridCategory"
    [dataSource]="dtCategory"
    [allowColumnReordering]="true"
    (onEditingStart)="logEvent('EditingStart')"
    (onInitNewRow)="logEvent('InitNewRow')"
    (onRowInserting)="logEvent('RowInserting')"
    (onRowInserted)="logEvent('RowInserted')"
    (onRowUpdating)="logEvent('RowUpdating')"
    (onRowUpdated)="logEvent('RowUpdated')"
    (onRowRemoving)="logEvent('RowRemoving')"
    (onRowRemoved)="logEvent('RowRemoved')"> 
 <!--<dxo-search-panel 
        [visible]="true" 
        [width]="540" 
        placeholder="Search..."></dxo-search-panel>  -->
         <dxo-editing 
            mode="popup"
            [allowUpdating]="true"
            [allowDeleting]="true"
         [allowAdding]="true">
            <dxo-popup
          
                [showTitle]="true"
                [width]="600"
                [height]="345"
                [position]="{ my: 'top', at: 'top', of: window }">
            
            </dxo-popup>
       
        </dxo-editing>
       <dxo-filter-row 
        [visible]="showFilterRow" 
        [applyFilter]="auto"></dxo-filter-row>
          <dxo-header-filter 
        [visible]="showHeaderFilter"></dxo-header-filter>
    <dxo-paging [pageSize]="10"></dxo-paging>
    <dxo-pager 
        [showPageSizeSelector]="true"
        [allowedPageSizes]="[5, 10, 20]"
        [showInfo]="true">
    </dxo-pager>
    
    <dxi-column dataField="CategoryID" [width]="100" id="CategoryID" ></dxi-column>
    <dxi-column dataField="CategoryName" id="CategoryName"></dxi-column>
    <dxi-column dataField="CategoryIcon" [caption]="Icon" [width]="100" [allowFiltering]="false"
        [allowSorting]="false" cellTemplate="categoryIcondt" >
    </dxi-column>
    <dxi-column
        dataField="CreatedDate"
        dataType="date">
    </dxi-column>
   
    <div *dxTemplate="let data of 'categoryIcondt'">
        <img [src]="data.value"/>
    </div>
</dx-data-grid>
</div>
</div>

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44560200

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档