Hi,

I am quite new to web2py so this might be a silly question I searched 
manual, forum and the web but I wasn't able to find solution.
I am making a simple SQLFORM.grid based on an model. What happens is that I 
cannot control the column order.
It seems that the columns in the grid appear in different ordering when 
sorting them. Moreover they don't seem to follow the same 
order of the fields specified for the grid.
Is there a way to prescribe the column ordering and have it blocked?

Thank you

*web2py version is*:
2.6.4-stable+timestamp.2013.09.22.01.43.37

*Model*:

db.define_table('sito',
    Field('id', type='id'),
    Field('nome', type='string', length=50),
    format='%(nome)s',
    migrate=False)

db.define_table('stazione',
    Field('id', type='id'),
    Field('sito_id', db.sito),
    Field('codice', type='string', length=20),
    Field('longitudine', type='decimal(30,9)'),
    Field('latitudine', type='decimal(30,9)'),
    Field('data_prelievo', type='date'),
    Field('profondita',  type='decimal(30,9)'),
    Field('lung_prelievo',  type='decimal(30,9)'),
    Field('geom',type='geometry()' ),
    format='%(codice)s',
    migrate=False)



*Controller:
*
def index():
    form = SQLFORM.grid(db.stazione,
                        
fields={db.stazione.codice,db.stazione.sito_id,db.stazione.data_prelievo},
                        headers={'stazione.sito_id' : 'Sito'},
                        field_id = db.stazione.id)
    
    return dict(form=form)

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

Reply via email to