Three questions about WebGrid

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Three questions about WebGrid

Herbert König

seems I can't solve two things about WebGrid.

1- how do I make a WebGrid column unsortable? In my case the
underlying collection is a sorted collection which is not user

2- I stumbled over WebGrid>>rowGreenIfTrue: and friends and I like it
a lot. If a column contains a link (added via >>addBlock) the #bold
argument is ignored. Minor aesthetic issue.

And while I'm at it:
To make the row above the Grid display the selected row in the grid, I
column: 3
          [:each |
          WebElement new
            addLinkTo: self observee
            text: each positionsText
            view: aViewSymbol     "This is in a reusable component"
            parameter: 'Selected'
            value: each idString].

and in every view I use this component I call:

  | selPos selectedId |
  selectedId := self session lastRequest queryAt: 'Selected'.
  selPos := self observee abrechnung positionen
              detect: [:each | each idString = selectedId]
              ifNone: [nil].
  selPos ifNotNil: [self observee selectedPosition: selPos]

And I had to implement idString on the model solely for this purpose.

Is there a way to do this with less code?

Ideally I would like:
column: 3
          [:each |
          WebElement new
            addText: each positionsText;
            onClick: [self observee selectedPosition: each.
            "now automagically update the line above the Grid
            with one more line of code"]].

Oops, maybe this is too much to expect?
But I feel I wrote a lot of code to achieve my end. Hopefully this is
mainly a lack of knowledge on my side.

Btw, the capitalised text in the picture is not my idea :-))


Herbert                          mailto:[hidden email]
Aida mailing list
[hidden email]

columns.PNG (17K) Download Attachment