Closed ItsAsbreuk closed 11 years ago
From the LazyModelList docs:
Custom
idAttribute
fields are not supported.
Hey, indeed..
I missed that.
Never considered to make it work though? I think it will be handy: I like LML - use it all the time. But now I run into serverdata with other unique id-fields...
Although I could transform all records to introduce 'id', but that would be a performancehit.
Marco.
@ItsAsbreuk There's no reliable way to make custom id attributes work in LazyModelList. Relying on modelClass.prototype.idAttribute
isn't a good solution since that prototype property may be overridden by a local property on an actual instance, and there's know way to know without creating an instance, which is exactly what LazyModelList is avoiding.
Ah, I understand. It makes me wonder why idAttribute is a prototype property and not an instanceproperty or an attribute. But there sure will be a good reason for that, so no need to argue.
Thx.
Of coarse... model needs to be a Class, no instance...
Still you could give LML an attribute (or instance-property) named 'idAttribute' and use that one. But my quess is you don't want to keep LML as light as possible :)
See online example: http://jsbin.com/aqotob/1/edit
TeslaNick came with this patch: http://jsbin.com/aqotob/2/edit
which might be useful.
Marco