开发者

Use another property in data element as id

I have data elements:

{
    'rid': '1',
    'id': '2',
    'name': 'asdw'
},
{
    'rid': '2',
    'id': '2',
    'name': 'dsddf'
},
{
    'rid': '3',
    'id': '2',
    'name': 'fffgg'
}

Each data 开发者_开发知识库element have the same value of "id" property (slickgrid throws me "Each data element must implement a unique 'id' property"). How can i use another property in data element as id (for example "rid")? I can not remove props from data object.


You can try setting your items using the setItems(data, objectIdProperty) method defined on DataView in file slick.model.js.

function setItems(data, objectIdProperty) {
     if (objectIdProperty !== undefined) idProperty = objectIdProperty;
     items = data;
     refreshIdxById();
     refresh();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜