From f74af4be73ae510d6dea7786009a993543a6aa09 Mon Sep 17 00:00:00 2001 From: Charles Davison Date: Thu, 8 Sep 2011 14:18:02 +0100 Subject: [PATCH] Docs --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index b3dc2114..cb229d0e 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,20 @@ Creates a sortable and editable list of items, which can be any of the above sch - Similar in use to the main 'type' schema attribute. - Defaults to 'Text' +**`toString`** + +- Optional, but recommended when using listType 'Object' +- A function that returns a string representing how the object should be displayed in a list item. +- When listType is 'NestedModel', the model's toString() method will be used + +Examples: + + var schema = { + users: { type: 'List', listType: 'Object', toString: function(user) { + return user.firstName + ' ' + user.lastName; + } + } + };