Hi Andrew Butenko,
This is my full html code
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="ecn.dev.virtualearth.net/.../mapcontrol.ashx;s=1" type="text/javascript"></script>
<script src="ClientGlobalContext.js.aspx"></script>
<script src="boggle_bingMapsJScript.js" type="text/javascript"></script>
<script src="boggle_AdvancedFindSearch.js" type="text/javascript"></script>
<script src="new_jquery" type="text/javascript"></script>
<script src="new_jquery_datatables" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
var oTable;
var guids = new Array();
function CreateML() {
//alert(contactsArray);
//if (window.opener != null && window.opener.contactsArray != null)
//contactsArray = window.opener.contactsArray;
//Open the map webresource
//var mapWindow2 = window.open(serverUrl + "/WebResources/new_CreateML", "mapWindow2", "toolbar=0,menubar=0,directories=0,scrollbars=1,width=450,height=200,left=700,top=500");
if (guids.length == 0) {
alert("Please select at least one row!");
}
else {
if (Xrm.Page.context.isOutlookClient()) {
openNewWindow(serverUrl + '/WebResources/boggle_CreateML', 'mapWindow2', 420, 120);
}
else {
PopupCenter(serverUrl + '/WebResources/boggle_CreateML', 'mapWindow2', 420, 120);
}
}
}
function PopupCenter(pageURL, title, w, h) {
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
var targetWin = window.open(pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
targetWin.opener = this;
}
function openNewWindow(pageURL, title, w, h) {
var targetWin = openStdWin(pageURL, title, w, h, 'status=1');
targetWin.opener = this;
}
/* Set properties for grid */
$(document).ready(function () {
oTable = $('#example2').dataTable({
"bPaginate": true,
"bLengthChange": true,
"bFilter": false,
"bSort": true,
"bInfo": true,
"bAutoWidth": true
});
//hide Guid column
oTable.fnSetColumnVis(6, false);
});
$('#example2 tbody tr').live('click', function () {
//clear array
Array.clear(guids);
$(this).toggleClass('row_selected');
var anSelected = fnGetSelected(oTable);
for (var i = 0; i < anSelected.length; i++) {
//alert(oTable.fnGetData(anSelected[i],6));
guids.push(oTable.fnGetData(anSelected[i], 6));
}
//alert(guids);
});
/* Get the rows which are currently selected */
function fnGetSelected(oTableLocal) {
return oTableLocal.$('tr.row_selected');
}
/* Select all rows */
function SelectAll() {
var nRows = oTable.fnGetNodes();
if (guids.length == 0) {
//alert('array is empty');
for (var i = 0; i < oTable.fnGetData().length; i++) {
$(nRows[i]).addClass('row_selected');
//alert(oTable.fnGetData(nRows[i],6));
guids.push(oTable.fnGetData(nRows[i], 6));
}
//alert(guids);
}
else {
//alert('array is not empty');
//clear array
Array.clear(guids);
for (var i = 0; i < oTable.fnGetData().length; i++) {
$(nRows[i]).addClass('row_selected');
//alert(oTable.fnGetData(nRows[i],6));
guids.push(oTable.fnGetData(nRows[i], 6));
}
//alert(guids);
}
}
/* Deselect all rows */
function DeselectAll() {
var nRows = oTable.fnGetNodes();
for (var i = 0; i < oTable.fnGetData().length; i++) {
$(nRows[i]).removeClass('row_selected');
}
//clear array
Array.clear(guids);
}
</script>
<script src="/_common/global.ashx?ver=-339091135" type="text/javascript">
</script>
<link href="/_common/styles/fonts.css.aspx" rel="stylesheet" type="text/css">
<link href="/_common/styles/global.css.aspx" rel="stylesheet" type="text/css">
<link href="/_common/styles/theme.css.aspx" rel="stylesheet" type="text/css">
<link id="1340119669188" href="ecn.dev.virtualearth.net/.../mapcontrol.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="new_demo_table" rel="stylesheet" type="text/css">
</head>
<body>
<div id="myMap" style="width: 100%; height: 80%; position: relative;"></div>
<div style="margin: 5px; width: 160px; text-align: center; float: right; cursor: pointer;" onclick="CreateML()" ;=""><img class="ms-crm-ImageStrip-AddToMarketingList_32" id="imgCreateML" alt="Add to Marketing List" src="/_imgs/ribbon/addtomarketinglist_32.png"> <br>Add to Marketing List </div>
<div style="width: 100%;">
<table>
<tbody><tr>
<td align="left"><button title="Select all" class="ms-crm-Button" id="btnSelectAll" style="width: 100px;" onmouseover="Mscrm.ButtonUtils.hoverOn(this)" onmouseout="Mscrm.ButtonUtils.hoverOff(this)" onclick="SelectAll()" ;="">Select all</button>
</td>
<td align="left"><button title="Deselect all" class="ms-crm-Button" id="btnDeselectAll" style="width: 100px;" onmouseover="Mscrm.ButtonUtils.hoverOn(this)" onmouseout="Mscrm.ButtonUtils.hoverOff(this)" onclick="DeselectAll()" ;="">Deselect all</button>
</td>
</tr>
</tbody></table>
</div>
<table class="display" id="example2" border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th>Full Name</th>
<th>Street</th>
<th>City</th>
<th>Country</th>
<th>Main Phone</th>
<th>Primary E-mail</th>
<th>Guid</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Full Name</th>
<th>Street</th>
<th>City</th>
<th>Country</th>
<th>Main Phone</th>
<th>Primary E-mail</th>
<th>Guid</th>
</tr>
</tfoot>
</table>
<div style="clear: both;"></div>
</body></html>