Table Resizing and Google InfoWindow

Table Resizing and Google InfoWindow

sonicbugsonicbug Posts: 26Questions: 0Answers: 0
edited May 2013 in DataTables 1.9
Hi,

I have searched high and low for an answer to my question but wasn't able to get a resolution to my question. I am trying to fit the datatable to fit inside a Google InfoWindow. Below is a snippet of code outlining how I approched to deal with this situationl

[code]
function drawTable(items,e) {
var tmpStr = "";
var tmpStr2 = "";

var contentString = [
'',
'',
'E. Coli Results',
'Cyanobacteria + Microcystin Results',
'',
'',
'' + beach_location + '',
'' + beach_region + '',
'',
/*
'',
'Sample Date',
'Average E. coli Density
(E. coli / 100 mL of sample)',
'Recreational Water Quality Guideline
(200 E. coli / 100 mL of sample)',
''
*/
].join('');

// add Ecoli Rows
for (var j = 0; j < items.length; j++) {
//console.log(items[j]);
tmpStr = tmpStr + ' ' + items[j][5] + '' + items[j][6] + '' + items[j][7] + '';
}

//contentString = contentString + tmpStr + '';
contentString = contentString + tmpStr + '';

var contentString2 = [
'',
'' + beach_location + '',
'' + beach_region + '',
'',
/*
'',
'Sample Date',
'Algase Toxin Microcystin',
'Recreational Guideline 20ug',
'Blue Green Algae Cells',
'Recreational Guideline',
''
*/
].join('');

// add Algae Rows
for (var j = 0; j < items.length; j++) {
//console.log(items[j]);
tmpStr2 = tmpStr2 + ' ' + items[j][9] + '' + items[j][10] + '' + items[j][11] + '' + items[j][12] + '' + items[j][13] + '';
}

contentString2 = contentString2 + tmpStr2 + '';

contentString = contentString + contentString2 + '';



infoWindow.setContent(contentString);
infoWindow.setPosition(e.latLng);

infoWindow.open(map);
$(".tabs").tabs({ selected: 0 });
$("#ecoli_table").dataTable({
"sPaginationType": "full_numbers",
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"aaSorting": [[0, "desc"]],
"bAutoWidth": false,

"aoColumns": [
{ "sWidth": "25px", "aTargets": ["_all"], "sTitle": "Sample_Date" },
{ "sWidth": "25px", "aTargets": ["_all"], "sTitle": "Average_E._coli_Density" },
{ "sWidth": "25px", "aTargets": ["_all"], "sTitle": "Recreational_Water_Quality_Guideline" }
],
"bProcessing": true,
/*
"aoColumns": [
{ "sTitle": "Sample_Date" },
{ "sTitle": "Average_E._coli_Density" },
{ "sTitle": "Recreational_Water_Quality_Guideline" }
]
*/
});

$('#algae_table').dataTable({
"sPaginationType": "full_numbers",
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"bAutoWidth": true,
"bProcessing": true,
"aaSorting": [[0, "desc"]],

"aoColumns": [
{ "sTitle": "Sample_Date" },
{ "sTitle": "Algal_Toxin_Microcystin" },
{ "sTitle": "Recreational_Guideline_20" },
{ "sTitle": "Blue_Green_Algae_Cells" },
{ "sTitle": "Recreational_Guideline" }
]
});
}
[/code]

Any suggestions are greatly appreciated. Thanks in advance.
Michael
This discussion has been closed.