<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;NOTE&lt;/span&gt;: As collection_view is an abstract class, you will be better off using list_view or source_list_view&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A Collection view is a view to display collections of data.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;NOTE&lt;/span&gt;&lt;/strong&gt;: All collections views &lt;strong&gt;must&lt;/strong&gt; be placed into a [[Scroll_view]] for proper operation.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;NOTE&lt;/span&gt; 2&lt;/strong&gt;: From SC version 0.9.16 on, :outlet is no more, so only include it for previous versions of SC.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code&gt;
    &amp;lt;%= collection_view :name_of_view, 
       :outlet =&amp;gt; true/false, 
       :example_view =&amp;gt; 'SC.ListItemView', 
       :is_editable =&amp;gt; true/false,
       :content_value_key =&amp;gt; 'nameofcontentvaluekey',
       :can_order_content =&amp;gt; true/false,
       :content_value_editable =&amp;gt; true/false,
       :can_reorder_content =&amp;gt; true/false,
       :bind =&amp;gt; { 
         :content =&amp;gt; 'App.collectionController.arrangedObjects',
         :selection =&amp;gt; 'App.collectionController.selection'
       }
%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Attributes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;name_of_view :: The name of the view for referencing in JavaScript&lt;/li&gt;
	&lt;li&gt;outlet :: Whether or not the view needs to be available in JavaScript (needs to be true to display dynamic content)&lt;/li&gt;
	&lt;li&gt;example_view :: The template view used to display a collection item&lt;/li&gt;
	&lt;li&gt;is_editable :: Set to false when you don&amp;#8217;t want the user to be able to edit the field&lt;/li&gt;
	&lt;li&gt;content_value_key =&amp;gt; The property of the record to be displayed. It can be a computed property.&lt;/li&gt;
	&lt;li&gt;can_order_content :: Whether the collection view allows to order the content&lt;/li&gt;
	&lt;li&gt;content_value_editable :: Whether the user is able to edit the value of the content&lt;/li&gt;
	&lt;li&gt;can_reorder_content :: Whether the view can be used to reorder content&lt;/li&gt;
	&lt;li&gt;bind
	&lt;ul&gt;
		&lt;li&gt;content :: The content of the collection controller. Set it to the arrangedObjects property of a collection controller.&lt;/li&gt;
		&lt;li&gt;selection :: The property of the collection controller the selection made by the user needs to be put into.&lt;/li&gt;
	&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Comments&lt;/h2&gt;
&lt;p&gt;Not all fields are yet in this description and the actual working of some properties may differ. Please feel free to correct or add something. &amp;#8211; Maurits&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span class=&quot;caps&quot;&gt;TODO&lt;/span&gt;:&lt;/strong&gt; Its nice that you&amp;#8217;ve said a &lt;i&gt;collection&lt;/i&gt; view is used to display a &lt;i&gt;collection&lt;/i&gt; of data&amp;#8230; but what other views would you use it inconjunction with? It would be nice to have example usage. Would you put a collection view inside another view? If so why? Would you put any views inside the collection view? If so why? Show examples of how the view would be used in an actual program, instead of in isolation. &amp;#8212; &lt;a href=&quot;http://github.com/gskluzacek&quot;&gt;gskluzacek&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To gskluzacek: that would indeed be a nice addition, for an example. I intented my initial description to be a reference entry. A soon as I have a proper example in which I can show every possible use, I will add it. -Maurits&lt;/p&gt;</body>
  <created-at type="datetime">2008-07-10T04:54:49-07:00</created-at>
  <id type="integer">34975</id>
  <permalink>collection_view</permalink>
  <repository-id type="integer">18944</repository-id>
  <title>Collection_view</title>
  <updated-at type="datetime">2008-09-12T15:59:03-07:00</updated-at>
  <user-id type="integer">14616</user-id>
</wiki>
