datagrid/dataedit without datastore?

25 views
Skip to first unread message

Willem Rein Oudshoorn

unread,
Dec 30, 2011, 5:40:25 AM12/30/11
to webl...@googlegroups.com
I am playing around with weblocks.
The standard datagrid/dataedit widget has most of the functionality I
want. However I am struggling with the datasource side of things.

I would like to give the datagrid an explicit list of items, and the
datastore seems to be getting in my way.

So take the following example, I have a class 'person and
want to display a list of persons in datagrid.
I would like to show two (or more) lists of persons, lets say:

1 - Friends
2 - Enemies

Now as far as I can tell I can configure the datagrid
with

:data-class 'person

However this will show all persons in a datagrid.

Does anybody have an idea or pointers how to approach this?

I can think of one way to do this, but that seems cumbersome:

- For each instance of the datagrid make a specific datastore
- Carefully manage each datastore to have the right instances.

So is there a better/easier way?
Oh note, I am not (at the moment :-)) interested
in persistence.

Kind regards
Wim Oudshoorn


Leslie P. Polzer

unread,
Jan 1, 2012, 10:30:31 AM1/1/12
to webl...@googlegroups.com

Take a look at the on-query slot; just specialize a datagrid
to use your own function there (which in turn can derive
the objects to return from the data-class slot, or have
its own logic to decide between Friends and Enemies).

Leslie

>
> Kind regards
> Wim Oudshoorn
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "weblocks"
> group.
> To post to this group, send email to webl...@googlegroups.com.
> To unsubscribe from this group, send email to weblocks+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/weblocks?hl=en.
>
>
>


--


Willem Rein Oudshoorn

unread,
Jan 4, 2012, 3:25:58 PM1/4/12
to webl...@googlegroups.com
"Leslie P. Polzer"
<s...@viridian-project.de> writes:

>
> Take a look at the on-query slot; just specialize a datagrid
> to use your own function there (which in turn can derive
> the objects to return from the data-class slot, or have
> its own logic to decide between Friends and Enemies).
>
> Leslie

Thank you for the hint. It took a few tries but I got it working.

Kind regards,
Wim Oudshoorn.

Reply all
Reply to author
Forward
0 new messages