CPCollectionViewItem

13 views
Skip to first unread message

Thomas Mueller

unread,
Sep 4, 2008, 9:50:04 PM9/4/08
to objec...@googlegroups.com
Hi,

I've just downloaded the frameworks and sample application and am
trying to display a table now.

So far I added a CPCollectionView to my window and am now trying to
add an item prototype:

CPCollectionViewItem itemPrototype = [[CPCollectionViewItem alloc] init];
[itemPrototype setView:[[MyView alloc] init]];
[tableView setItemPrototype:itemPrototype];

tableView is my CPCollectionView and MyView a subclass of CPView.
At the moment I get an "Uncaught SyntaxError: Unexpected Identifier
http://localhost/MyApp/Frameworks/Objective-J/Objective-J.js (line
1213)" when I get to the line where I'm trying to create the
CPCollectionViewItem.

What am I doing wrong?

Thomas

Ross Boucher

unread,
Sep 4, 2008, 9:54:52 PM9/4/08
to objec...@googlegroups.com
You can't declare

CPCollectionViewItem itemPrototype =

Should be

var itemPrototype =

Sent from my iPhone.

On Sep 4, 2008, at 6:50 PM, "Thomas Mueller" <thomasm...@googlemail.com

Thomas Mueller

unread,
Sep 5, 2008, 1:00:01 AM9/5/08
to objec...@googlegroups.com
Thanks, I got it working.

I'm wondering, though, whether this is the right approach if I want to
display a table with multiple columns. I guess I could display
multiple data items in the CPCollectionViewItem's view, but then I
still wouldn't have column headers and it wouldn't be possible to
resize the columns, for instance.

Looking at the API I'm afraid there is no support for tables yet. Am I right?

If tables are not yet supported, is somebody already working on this?
Otherwise I might have a go at it, though I'm afraid that might be a
bit over my head :-)

Regards,
Thomas


2008/9/5 Ross Boucher <rbou...@gmail.com>:

Ross Boucher

unread,
Sep 5, 2008, 2:11:08 AM9/5/08
to objec...@googlegroups.com
What you're doing is the best solution for the time being.

We don't have CPTableView yet, but some of the beginnings of the code
is there. I'll be working on this hopefully beginning next week, but
if you'd like to help out let me know.

-Ross

Ian

unread,
Sep 5, 2008, 5:41:01 AM9/5/08
to objec...@googlegroups.com
Just to second that motion really, CPTableView was the first thing I looked for.
Feeling slightly giddy about all this by the - my custom JS framework is heavily based on a lot of the Cocoa/ObjC paradigms so this is very exciting stuff.

Cheers
Ian
Reply all
Reply to author
Forward
0 new messages