Willem Rein Oudshoorn wrote: > 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.
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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/weblocks?hl=en. > > > -- -- You received this message because you are subscribed to the Google Groups "weblocks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/weblocks?hl=en.
