great, thanks all i´ll give that a go tomorrow!
On Thu, Sep 13, 2018 at 5:39 PM Anthony <[email protected]> wrote:
> On Thursday, September 13, 2018 at 8:36:11 AM UTC-4, Marcelo Huerta wrote:
>>
>> El jueves, 13 de septiembre de 2018, 8:10:48 (UTC-3), Matthew J Watts
>> escribió:
>>>
>>> Hello all
>>>
>>> Is there a way to pre populate the 'search field' of the SQLFORM.grid?
>>>
>>>
>>>
>> In your URL to the function containing the grid, you can pass the search
>> string in the vars dictionary. Just assign it to the "keywords" key.
>>
>
> That's the way to go if you want the grid to show the actual results of
> the search. If you want the standard set of records but simply want to
> pre-populate the search box, you can do:
>
> grid = SQLFORM.grid(db.mytable)
> search_input = grid.element('#w2p_keywords')
> if search_input:
> search_input['_value'] = 'My keywords'
>
> Anthony
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/yohSjabLPCE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
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.