To answer to Dave's questions:
- Yes they can select more than one line. Wat I call the "selected lines" 
are the lines fetched by the current query.
- I only need that on the server side. When you write "If on the server,  
doesn't the db query for the row selected give that value?" I do not really 
understand. In fact I think I need (on the server the side) to know what is 
the current query and based on it, to build an appropriate query with the 
appropriate "DISTINCT" clause. But I do not even know how to get the query 
that generated the current grid selection...

Thanks

On Tuesday, November 14, 2017 at 8:42:53 AM UTC+1, Dave S wrote:
>
>
>
> On Monday, November 13, 2017 at 9:57:25 PM UTC-8, Vincent Borghi wrote:
>>
>> Hello,
>>
>> I have a "normal' web2py grid with columns (including a column named 
>> "country"), thru which the users can query the db to select the lines they 
>> are interested in. 
>>
>
> Can they select more than 1 line at a time?
>   
>
>> Once the users have performed their selection, I need to be able to 
>> determine the distinct values of (e.g.) the "country" column for the 
>> current selection.
>> This will allow different things, like showing the users the list of the 
>> current distinct values, or triggering a specific action on those distinct 
>> values, etc.
>>  
>>
> Is there  some code around, ready to use,  or at least hicn can be a basis 
>> or just as an example ?
>>
>> Thanks
>>
>
>
> Do you need to know this on the client-side before requesting action from 
> the server?  Or only on the server in the controller/function that matches 
> the link?
>
> If on the server,  doesn't the db query for the row selected give that 
> value?
>
> If on the client, you would be looking at picking up the proper td entry.  
> I don't have a grid example going at the moment.  I have an SQLTABLE 
> example that doesn't seem to name anything in the table (unlike an SQLFORM 
> where everything is named).  But for a grid, aren't you intercepting a 
> click on the link inside a td, and the other td would just be one of its 
> siblings?
>
> /dps
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to