Hi step,

You can do the following in your controller after defined your grid
x = SQLFORM.grid()
x.element(_type='submit')['_value'] = T("something")

It will set all submit buttons labes as something in the grid


2013. július 12., péntek 16:14:24 UTC+2 időpontban step a következőt írta:
>
> How can I change SQLFORM.grid's submit button's label from python and 
> without resorting to javascript? I tried
>
> SQLFORM.grid(..., formargs=dict(submit_button=T('new 
> label'),formname='grid')
>
> but it generated an error:
>
>   File "gluon/sqlhtml.py", line 2066, in grid
>     **sqlformargs)
> TypeError: type object got multiple values for keyword argument 
> 'submit_button'
>
> Currently I do use jQuery as a work-around, but I'm interested in a pure 
> python solution
> $('#grid').find('input[type="submit"]').val('{{=T("new label")}}');
>
> Thanks in advance
>

-- 

--- 
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/groups/opt_out.


Reply via email to