I am trying with something like this

links = [lambda row: A('',_class='glyphicon glyphicon
glyphicon-remove-sign',
_href =URL('settings','deactivate',
vars=dict(s = '2')))]

But I cannot send vars to my controller function

I also tried with callback()

Any idea why?

I need to send id of the record and two static parametes e.g. 'tablename',
'tablefiled'



2015-09-14 23:46 GMT+08:00 Vid Ogris <vid.og...@gmail.com>:

> Thank you for fast reply
>
> Will try with links. I have more then just active or inactive status, so i
> guess the other option is out. But will keep that in mind for next projects
> and/or tasks
>
> thank you again
>
> 2015-09-14 23:42 GMT+08:00 Anthony <abasta...@gmail.com>:
>
>> You can use the "links" argument to create additional buttons/links,
>> either in separate columns or in the column that includes the
>> view/edit/delete buttons.
>>
>> Alternatively, you might consider setting up record versioning, either
>> for just this table
>> <http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer>,
>> or for the whole database
>> <http://web2py.com/books/default/chapter/29/09/access-control#Record-versioning>.
>> If you include an "is_active" boolean field in the table, the record
>> versioning functionality will preserve all records and simply set
>> is_active=False for deleted records (it will also add a common_filter to
>> the table to filter out is_active=False records from all queries).
>>
>> If you want the is_active/filtering functionality of record versioning
>> but you don't actually want to save the older versions of records in an
>> archive table, you can do this manually by (a) adding your own
>> common_filter to filter out inactive records, and (b) adding a
>> _before_delete callback that sets in_active=False and then abandons the
>> delete operation.
>>
>> The benefit if using the record versioning functionality (or manual
>> alternative described above) is that it will apply to any delete operations
>> on the table (done via the DAL), not just those coming from this particular
>> grid interface.
>>
>> Anthony
>>
>>
>> On Monday, September 14, 2015 at 11:21:13 AM UTC-4, Yebach wrote:
>>>
>>> Hello
>>>
>>> Is there a way to use SQLform.grid and add a function and new buttons
>>> for delete record and other purposos
>>>
>>> I do not allow user to actually delete records just to change status in
>>> database, so the record still stays there.
>>>
>>>
>>> Any suggestions?
>>>
>> --
>> 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/3T1Qaf39wJg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Lep pozdrav
>
> Vid Ogris
>
>
>


-- 
Lep pozdrav

Vid Ogris

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to