Smartgrid layout question

80 views
Skip to first unread message

funm...@gmail.com

unread,
Apr 23, 2013, 9:49:42 PM4/23/13
to web...@googlegroups.com
Hi all,

I have a couple questions about the layout built by smartgrid.

1) My smartgrid has a couple linked tables. They show up nicely as links on the right hand side of the grid. Is there a way to control which linked table to be listed first? It looks like that it is sorted by alphabetical order from A to Z.

2) when the page is built with the smartgrid, it shows the db name in the upper left area. Is there a way to change it to something else?

Thanks

Cliff Kachinske

unread,
Apr 24, 2013, 5:32:32 AM4/24/13
to web...@googlegroups.com
1) The code says it is possible to pass in linked_tables as a dictionary, in which case it will put the links together in the order produced by linked_tables.keys().  This may or may not give you what you want.  Quoting the Python web site, "The keys() method of a dictionary object returns a list of all the keys used in the dictionary, in arbitrary order (if you want it sorted, just apply the sorted() function to it)."

My suggestion is to just play with it.  As a starting point, try linked_tables = dict(sometable='id', othertable='id')

2) Check layout.html.  Again, spend some time playing with it. 

fun man

unread,
Apr 24, 2013, 11:00:40 AM4/24/13
to web...@googlegroups.com
sorry... i need some coffee. Typed the wrong name of table above.

Case 1) - I still can't get demo_detail to be listed first. My smartgrid shows achievement first and then demo_detail.


On Wed, Apr 24, 2013 at 10:59 PM, fun man <funm...@gmail.com> wrote:
Thanks Cliff.

I've tried a few combination, and it didn't get to what I want.

1) linked_tables=['demo_detail','achievement'].sort(reverse=True)
2) linked_tables=dict(demo_detail=id,achievement='id')

Case 1) - I still can't get achievement to listed first. My smartgrid shows achievement first and then demo_detail.
Case 2) For the linked_tables=dict() one, the linked tables disappeared from the smartgrid.

regards,


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/52XMbp783Go/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


fun man

unread,
Apr 24, 2013, 10:59:29 AM4/24/13
to web...@googlegroups.com
Thanks Cliff.

I've tried a few combination, and it didn't get to what I want.

1) linked_tables=['demo_detail','achievement'].sort(reverse=True)
2) linked_tables=dict(demo_detail=id,achievement='id')

Case 1) - I still can't get achievement to listed first. My smartgrid shows achievement first and then demo_detail.
Case 2) For the linked_tables=dict() one, the linked tables disappeared from the smartgrid.

regards,
On Wed, Apr 24, 2013 at 5:32 PM, Cliff Kachinske <cjk...@gmail.com> wrote:

--

funm...@gmail.com

unread,
May 13, 2013, 2:29:36 AM5/13/13
to web...@googlegroups.com
Sorry... it's really my bad. But to answer myself to share what could be done.
2) linked_tables=dict(demo_detail='id',achievement='id')
                                                ^^^^^^^
Option 2 is indeed working. I missed the '' for the id... Now, i am happy.

Cliff, Thanks very much for your help on this.

Regards,
funmanhk

funm...@gmail.com於 2013年4月23日星期二UTC-7下午6時49分42秒寫道:

Ovidio Marinho

unread,
May 13, 2013, 8:53:12 AM5/13/13
to web...@googlegroups.com
I know this discursão here for large dogs, but speaking station where I want to move. I have a field to upload and would not want him to show me to my table a default name "file", does anyone know how to replace this with an icon?

thanks!

      


         Ovidio Marinho Falcao Neto
                 Web Developer
             ovid...@gmail.com 
               83   8826 9088 - Oi
               83   9336 3782 - Claro
                        Brasil
              


2013/5/13 <funm...@gmail.com>
--
 
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

Ovidio Marinho

unread,
May 13, 2013, 8:54:42 AM5/13/13
to web...@googlegroups.com
Know to discussion here is for large dogs, but speaking station where I want to move. I have a field to upload and would not want him to show me to my table a default name "file", does anyone know how to replace this with an icon?

      


         Ovidio Marinho Falcao Neto
                 Web Developer
             ovid...@gmail.com 
               83   8826 9088 - Oi
               83   9336 3782 - Claro
                        Brasil
              


2013/5/13 <funm...@gmail.com>
Sorry... it's really my bad. But to answer myself to share what could be done.
--

fun man

unread,
May 15, 2013, 6:49:40 AM5/15/13
to web...@googlegroups.com
Ovidio,

I have a similar need, but not exactly an icon. I want to change the "file" link to reflect the original file name. I got too busy and haven't got enough time to research it.

If anyone know how to or may point a direction for you or me, it will be great.


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/52XMbp783Go/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages