简体   繁体   English

UI网格在每个单元上的不同数据类型实现

[英]Different datatype implementation on each cell for UI Grid

I am using UI Grid for my spreadsheet implementation. 我将UI Grid用于电子表格实现。 My grid consists of complex big data. 我的网格由复杂的大数据组成。 How do i access individual cell/cells in the table to assign them datatypes . 我如何访问表中的单个单元格为其分配数据类型。

[My grid example is as follows:][1] [我的网格示例如下:] [1]

  [1]: http://plnkr.co/edit/3YskfpKIe4UFjpTAIh5o?p=preview

It looks like most of your example fields would be strings. 看起来您的大多数示例字段都是字符串。 To add types you would add the type to the columnDefs. 要添加类型,您可以将type添加到columnDefs中。 A list of acceptable types can be found here in the "types" section. 可以在“类型”部分中找到可接受的类型列表。 ColumnDef Documentation ColumnDef文档

  columnDefs: 
  [
    { name:'firstName', field: 'first-name', type: 'string' },
    { name:'1stFriend', field: 'friends[0]', type: 'string' },
    { name:'city', field: 'address.city', type: 'string' },
    { name:'getZip', field: 'getZip()', enableCellEdit: false, type: 'string' }
  ]

EDIT: I see your questions ask specifically how to do this on a cell. 编辑:我看到您的问题专门询问如何在单元格上执行此操作。 I don't know why you would want to do this usually all cells of a column share a type. 我不知道为什么您通常要这样做,所以列的所有单元格都共享一个类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM