2017-04-28 20:45 GMT+01:00 Richard Vézina <ml.richard.vez...@gmail.com>:
> OPTION(opt['value'], _value=opt['id']) Than you it works now I still need to read the db into myfields def myfunc(): myfields={ "truck":{"tja":[OPTION("j111",_value=1),OPTION("j222",_value=2)],"abc":[OPTION("j333",_value=3),OPTION("j444",_value=4)]}, "driver":{"tja":[OPTION("joe",_value=10),OPTION("ana",_value=20)],"abc":[OPTION("manuel",_value=30),OPTION("Bril",_value=40)]}, "galera":{"tja":[OPTION("g111",_value=100),OPTION("g222",_value=200)],"abc":[OPTION("g333",_value=300),OPTION("g444",_value=400)]}, } res=[] for row in myfields: temp=[] for partner in myfields[row]: temp.append(OPTGROUP(*myfields[row][partner],_label=partner)) # db.log.insert(temp) res.append( LABEL(row, SELECT(*temp, _class="js-example-basic-single js-states form-control select2-hidden-accessible",_id=row,_tabindex="-1", _onchange="ajax('echo2?id='+this.value+'&newText='+'xxx'+'&uuid='+'uuid',[],':eval')" ) ,_for=row)) return res <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Sem vírus. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> -- 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.