Selectable Table

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

Selectable Table

Ron Teitelbaum

Hello all,

 

I’ve been looking at adding a selectable table.  One that has highlighted rows, highlights rows on mouse over and allows a click to select the row.

 

By any chance does this already exist?  Is there a way to add a callback to tableRow?

 

Thanks for your help!

 

Ron Teitelbaum


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Selectable Table

Boris Popov, DeepCove Labs (SNN)

I’ve implemented one for our application in the reporting framework by adding conditional “row actions” to “reports” and rendering them in the panel at the bottom of the report. Then, I would implicitly add a “selection” column to the table that contains a checkbox for each “row”. That checkbox knows the “id” of the current “tr” as well as array of “actions” that need to be disabled if this row is selected. Then an “onClick” event wires it all together to call a small piece of JavaScript that adds/removes a “selected” class to the “tr” depending on the state of the checkbox as well as calls main action panel update function that goes through all selection checkboxes in the report, collects all actions that need to be disabled and enables the remaining ones. It sounds complicated, but it only took a few hours of learning Prototype (it helps a lot, really) and tweaking the JavaScript until it worked.

 

As far as making this into a reusable component, I’m sure it could be done, but its tied with the rest of our reporting right now and I don’t know if I’ll ever have time to untangle it :(

 

Hope this helps,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ron Teitelbaum
Sent: Wednesday, October 18, 2006 1:09 PM
To: 'The Squeak Enterprise Aubergines Server - general discussion.'
Subject: [Seaside] Selectable Table

 

Hello all,

 

I’ve been looking at adding a selectable table.  One that has highlighted rows, highlights rows on mouse over and allows a click to select the row.

 

By any chance does this already exist?  Is there a way to add a callback to tableRow?

 

Thanks for your help!

 

Ron Teitelbaum


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Selectable Table

Mark Miller
In reply to this post by Ron Teitelbaum
It's interesting you bring this up. I was just thinking about this today. When I was developing web apps. with ASP.Net I used a web control called DataGrid often (I think it's now called DataGridView). It was good at displaying rows of database records. Lots of ASP.Net developers used it. It visually handled displaying/paging through data, selecting, editing data in place, and deleting records. It had default functionality for each of these actions, but it was configurable, so developers could put in their own controls for each (say, a dropdown listbox for editing a column value, instead of a textbox). It would be neat to see that for Seaside somehow, if it doesn't already exist. The core functionality controlled the display of the row data, event handling, and switching modes. The rest was customizable.
 
---Mark
 
-------------- Original message --------------
From: "Ron Teitelbaum" <[hidden email]>

Hello all,

 

I’ve been looking at adding a selectable table.  One that has highlighted rows, highlights rows on mouse over and allows a click to select the row.

 

By any chance does this already exist?  Is there a way to add a callback to tableRow?

 

Thanks for your help!

 

Ron Teitelbaum


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Selectable Table

Ron Teitelbaum
In reply to this post by Boris Popov, DeepCove Labs (SNN)

Hi Boris,

 

Yeah that is very helpful, thanks for the info!

 

Ron

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Boris Popov
Sent: Wednesday, October 18, 2006 4:21 PM
To: [hidden email]; The Squeak Enterprise Aubergines Server - general discussion.
Subject: RE: [Seaside] Selectable Table

 

I’ve implemented one for our application in the reporting framework by adding conditional “row actions” to “reports” and rendering them in the panel at the bottom of the report. Then, I would implicitly add a “selection” column to the table that contains a checkbox for each “row”. That checkbox knows the “id” of the current “tr” as well as array of “actions” that need to be disabled if this row is selected. Then an “onClick” event wires it all together to call a small piece of JavaScript that adds/removes a “selected” class to the “tr” depending on the state of the checkbox as well as calls main action panel update function that goes through all selection checkboxes in the report, collects all actions that need to be disabled and enables the remaining ones. It sounds complicated, but it only took a few hours of learning Prototype (it helps a lot, really) and tweaking the JavaScript until it worked.

 

As far as making this into a reusable component, I’m sure it could be done, but its tied with the rest of our reporting right now and I don’t know if I’ll ever have time to untangle it :(

 

Hope this helps,

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ron Teitelbaum
Sent: Wednesday, October 18, 2006 1:09 PM
To: 'The Squeak Enterprise Aubergines Server - general discussion.'
Subject: [Seaside] Selectable Table

 

Hello all,

 

I’ve been looking at adding a selectable table.  One that has highlighted rows, highlights rows on mouse over and allows a click to select the row.

 

By any chance does this already exist?  Is there a way to add a callback to tableRow?

 

Thanks for your help!

 

Ron Teitelbaum


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Selectable Table

Yanni Chiu
In reply to this post by Ron Teitelbaum
Ron Teitelbaum wrote:
> I’ve been looking at adding a selectable table.  One that has
> highlighted rows, highlights rows on mouse over and allows a click to
> select the row.
>
> By any chance does this already exist?  Is there a way to add a callback
> to tableRow?

Over at http://rising.seasidehosting.st/seaside/saltsprayadmin
is something similar to the DataGrid described by Mark (mmille10@...).
It doesn't do in-place editting (because I hadn't thought of it),
but it does use the last row as an create/add new form.

The code is reusable, but is heavily dependant on my internal
model representation, so would be hard to extricate and still
be usable. I can describe more of the implementation, but there's
no rocket science in it.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside