What is the purpose of the ReaderID attribute in <ext:JsonReader>?
I'开发者_运维百科m learning how to use Coolite at the moment. I'm trying to use the Store
element but I don't know what the ReaderID
attribute of the JsonReader
does?
The .ReaderID
property is a little confusing. Here's the definition:
Name of the property within a row object that contains a record identifier value. Defaults to id
Basically, its the name of property in the data item which should be used as the "ID" for that row.
For example, if your 'Customer' object has a "CustomerID"
property, then you should set the .ReaderID
property to "CustomerID"
.
FYI, as of Ext.NET v1.x, the .ReaderID
property has been renamed to .IDProperty
.
More information available at (client-side docs):
http://dev.sencha.com/deploy/ext-3.3.1/docs/?class=Ext.data.JsonReader&member=idProperty
Hope this helps.
Without checking specifically I would assume that the 'ReaderID' property has the same benefits as any 'ID' property, in that it gives a unique reference to the element.
This is often so that you can find it by the ID and perform functions directly upon a specific instance, rather than finding it by type or having to loop through all the items on a page and locate the specific instance you're after.
精彩评论