You can also use a widget:
def textarea_widget(f,v):
inp = SQLFORM.widgets.text.widget(f,v)
inp['_cols'] = 50
inp['_rows'] = 50
return inp
db.table.field.widget = textarea_widget
On Nov 29, 5:39 am, "mr.freeze" <[email protected]> wrote:
> You can do:
> form = crud.create(db.table)
> textarea = form.element('textarea')
> textarea['_rows'] = 50
> textarea['_cols'] = 50
>
> form.element will grab the first matching element. If you want to be
> more specific you can do:
> form.element('textarea',_id='table_field')
>
> On Nov 29, 4:11 am, Emceha <[email protected]> wrote:
>
> > Here is my controller code:
>
> > def dodaj_artykul():
> > form=crud.create(db.artykuly,next='pokaz_artykul/[id]')
> > return dict(form=form)
>
> > I see that textarea always has cols=40 and rows=10 - I wanted to
> > change that value but I haven't found any straight forward example to
> > do it using CRUD only?
>
> > Should I use SQLFORM?
>
> > Thanks
>
>