Please explain us better what you want to do. Form you code looks like you 
want one map (not one point) for each row in the grid. This is going to be 
awfully small. Anyway, Try change this:

return DIV(_id = row.id), scr0, scr1

into

return DIV(DIV(_id = row.id), scr0, scr1)



On Tuesday, 31 May 2016 08:02:26 UTC-5, 黄祥 wrote:
>
> testing to put it on the SQLFORM.grid links no error occured but the 
> result is not expected
> e.g.
> *controllers*
> def check_point_admin(row):
> scr0 = SCRIPT("""
> function initMap() {
> var mapDiv = document.getElementById(%s);
>
> var latlon = new google.maps.LatLng( %s, %s );
>
> var mapOptions = {
>         center: latlon,
>         zoom: 15
>         };
>
>         var map = new google.maps.Map(mapDiv, mapOptions);
>
>         var marker = new google.maps.Marker({
>    position: latlon, 
>    map: map
>   });
> }
>             """ % (row.id, row.lat, row.lon)
>     )
>
> scr1 = SCRIPT(
> _src="https://maps.googleapis.com/maps/api/js?callback=initMap";
>     )
>
> return DIV(_id = row.id), scr0, scr1
>
> def report_check_point():
> table = db.check_point
> links = [dict(header = T('Image'), 
>  body = lambda row: check_point_admin(row)
> )
> ]
> grid = SQLFORM.smartgrid(table, links = links)
> return locals()
>
> any idea how to achieve it on web2py?
>
> thanks and best regards,
> stifan
>
>

-- 
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