如何在DataTable脚本中调用该函数

时间:2014-04-01 05:52:24

标签: javascript google-maps datatables

我想用函数调用函数,并将其返回值调用到datatable。并且该值显示在datatable td

"mData": "address",
            "fnRender": function ( obj ) {
                var latlng = new google.maps.LatLng(obj.aData['latitude'], obj.aData['longitude']);
                geocoder.geocode({
                    'latLng': latlng
                }, function (results, status) {
                    if (status == google.maps.GeocoderStatus.OK) {
                        if (results[0]) {
                            var address = results[0].formatted_address;
                            console.log(address);
                            return address;
                            callback(address);
                        } else {
                            alert('No results found');
                        }
                    } else {
                        alert('Geocoder failed due to: ' + status);
                    }


                });

此处地址显示在数据表中。在mData中。如何分配

0 个答案:

没有答案