Filtering a grid view

22 views
Skip to first unread message

Ron Parker

unread,
Feb 23, 2011, 10:23:42 AM2/23/11
to webl...@googlegroups.com
I'm trying to display something like a gridview that only displays
items that match a certain criteria. My current approach is partially
working. Im using a filtered-datagrid widget and a filtered-table-view
class.

The filtered-table-view class is derived from table-view with a custom
render-object-view-impl method that is basically table-view's method
with a conditional in the mapc lambda that only applies
with-table-view-body-row for the rows that should display.

The following methods are basically to see what's going on:

(defmethod with-table-view-body-row ((view filtered-table-view) obj
widget &rest args)
(format t "w-t-v-b-r ~A~%" (slot-value obj 'name))
(call-next-method))

(defmethod render-table-view-body-row ((view filtered-table-view) obj
widget &rest args)
(format t "r-t-v-b-r ~A~%" (slot-value obj 'name))
(call-next-method))

And the filtered-datagrid widget inherits from datagrid. It's only
custom method is a copy of the dataseq-view for datagrid. I'm not
actually sure I need this part at all.

The *-table-view-body-row methods are getting called and the output
looks correct except no rows, or headers are being displayed I just
get the "(Total of ~A ~A)" summary followed by a horizontal grey bar.

So I'm looking for ideas or alternative solutions to this problem.

Thanks,

Ron

nunb

unread,
Feb 24, 2011, 3:17:18 AM2/24/11
to webl...@googlegroups.com
There is some old code at http://paste.lisp.org/display/85577

Perhaps you could compare your approach to that?

hth,
 nandan

Ron Parker

unread,
Feb 24, 2011, 12:24:29 PM2/24/11
to weblocks

On Feb 24, 2:17 am, nunb <nandan.bagc...@gmail.com> wrote:
> There is some old code athttp://paste.lisp.org/display/85577

Thanks nandan. I had found http://paste.lisp.org/display/81353 and had
begun on a solution based upon that before coming across the one you
recommended. My pared down version is at http://paste.lisp.org/display/119966.
Instead of implementing isearch-style functionality it takes a
filtering function.

I doesn't look like 85577 supports passing a filter function, but I am
curious what does it offer over 81353?

Thanks again,

Ron

o_z

unread,
Nov 15, 2012, 3:48:09 AM11/15/12
to webl...@googlegroups.com
I have worked on filtering data and made widget for it https://github.com/html/weblocks-filtering-widget it could be used for simple and some complex cases.

четверг, 24 февраля 2011 г., 19:24:29 UTC+2 пользователь Ron Parker написал:
Reply all
Reply to author
Forward
0 new messages