Hi Alvin,

On 12/9/05, aw <[EMAIL PROTECTED]> wrote:
> I am not clear on exactly how you use yours.  I will have to spend more
> time looking at the code.  It seems like there it takes the results of
> an Select results object and places it in a form with the option of
> editting or deleting it.  All columns are displayed.

That widget is specifically there for the "fastdata" controller, which
is the speedy way to get going with basic CRUD. (The controller code
isn't checked in yet).

Use of the widget is simple enough:

grid.insert(your_select_results)

> I also pass in a config array.  This allows some of the columns to be
> links instead of text data.  There are currently 3 options for the
> links types.  I also allowed you to specify tooltips for the column
> headers.

That kind of configuration is what you pass in at instantiation time.
It's the actual data that should wait until rendering time.

> In my PHP code, I have a ton more options but I wanted to throw it out
> there fast to see if it is worthwhile.   Plus, the generated links are
> not appearing as links.
>
> It looks like your code is getting around the porblem by creating the
> links in KID templates.  I was considering that as an option.  Instead
> of assembling the grid in the widget code, I could assemble it in a
> template function.  Your function seems to be an intermediary where the
> KID function is in in widget code.

I wouldn't use string concatentation... I'd put all of the HTML
generation in the template. It's much cleaner, and Kid will ensure
that you don't end up with bogus markup.

The grid that I pointed you to just takes in a SelectResults.
Obviously, you can't get the link URL from a SelectResults object.
What you could do, is either pass in (or override) a function that
computes the link for a given column in the grid. For example,

{'name': lambda value: "http://foo.bar/edit?id="+str(value.id)}

This would say that the "name" column should link to the edit URL,
passing in the ID of the object.

Kevin

Reply via email to