SlickGrid 列 - id 和 field 之间的区别
一个简单的问题,我无法锻炼。在列定义中,字段属性和 id 属性之间有什么区别...Fx..
columns.push({ id: "officeId", name: "Office Id", field: "officeId", width: 40 }) ;
它们什么时候会不同/为什么是两个?
谢谢? 蒂姆
A simple question i cant workout. In a column definition whats the difference between the field property and the id property...Fx..
columns.push({ id: "officeId", name: "Office Id", field: "officeId", width: 40 });
When would they be different/why two?
Thanks?
Tim
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
id
只是列的唯一标识符。您可以将其设置为您想要的任何内容。它的唯一用途是当您想从代码中引用列时提供标识符。field
指定列如何绑定到基础数据。假设您的数据如下所示:当您定义列时,您可以告诉它要显示数据数组中的哪个值。
The
id
is just a unique identifier for the column. You can set it to anything you want. It's only use is to provide an identifier when you want to refer to your columns from code.The
field
specifies how the column binds to the underlying data. Suppose your data looks like this:When you define the column you can tell it which value you want to display from your data array.