Cordova белый экран при использовании сетки jqxwidgets
Мы используем сетку jqxwidgets на одной из наших страниц, приложение работает нормально на устройствах с Android 4.4.2 и на всех устройствах IOS, но оно не работает в версии Android 4.4.4 Kikat, оно показывает белый экран и показывает сообщение Канал не уволен: onDOMContentLoaded
и мой код
<script type="application/javascript" src="js/jqxwidgets/jqxcore.js"></script>
<script type="application/javascript" src="js/jqxwidgets/jqxdata.js"></script>
<script type="application/javascript" src="js/jqxwidgets/jqxbuttons.js"></script>
<script type="application/javascript" src="js/jqxwidgets/jqxscrollbar.js"></script>
<script type="application/javascript" src="js/jqxwidgets/jqxlistbox.js"></script>
<script type="application/javascript" src="js/jqxwidgets/jqxdropdownlist.js"></script>
<script type="application/javascript" src="js/jqxwidgets/jqxmenu.js"></script>
<script type="application/javascript" src="js/jqxwidgets/jqxgrid.js"></script>
<script type="application/javascript" src="js/jqxwidgets/jqxgrid.pager.js"></script>
<script type="application/javascript" src="js/jqxwidgets/jqxgrid.selection.js"></script>
<script type="application/javascript" src="js/jqxwidgets/jqxpanel.js"></script>
<!-- <script type="application/javascript" src="js/jqxwidgetsjqxgrid.filter"></script>-->
<script type="application/javascript" src="js/jqxwidgets/demos.js"></script>
<!-- <script type="application/javascript" src="js/jqxwidgets/simulator.js"></script>-->
<!-- <script type="application/javascript" src="js/jqxwidgets/generatedata.js"></script>-->
$(document).ready(function () {
debugger;
var screen = window.screen.availWidth;
var data = datagrid;
if (data != null && data != "" && data != undefined) {
data.sort(function (a, b) {
if (a.TaskID > b.TaskID)
return -1;
if (a.TaskID < b.TaskID)
return 1;
// a must be equal to b
return 0;
});
// window.localStorage.setItem("grid", datagrid);
// data = window.localStorage.getItem("grid");
}
var source =
{
localdata: data,
datatype: "array"
};
var cellsrenderer = function (row, columnfield, value, defaulthtml, columnproperties) {
return '<button>First button</button><button>Second button</button>';
};
var columnrenderer = function (row, column, value) {
return '<div style="text-align:center; margin-top: 5px; ">' + row + '</div>';
}
var linkrenderer_TaskName = function (row, column, value) {
return linkrenderName('jqxgrid', row, column, value);
}
function linkrenderName(jqxGridID, row, column, value) {
var rowdata = $('#' + jqxGridID).jqxGrid('getrowdata', row);
var linkName = "";
if (rowdata != null) {
//OpenModalDialog('Alerg',rowdata.ProjectID, '80%', '20%');
StrTaskId = rowdata.ProjectID;
StrTaskName = JSON.stringify(rowdata.TaskName.replace(/'/g, '"'));
stsTask = JSON.stringify(rowdata.Status);
linkName = "<a target='_blank' style='width:100%;text-align: center; margin-top:5px;' onclick='getTaskInfo( " + rowdata.ProjectID + "," + rowdata.TaskID + "," + stsTask + "," + StrTaskName + ")'>" + '<div style="width:100% ">' + rowdata.TaskName + '</div>' + "</a>";
}
return '<div style="text-align:center; margin-top: 5px; ">' + linkName + '</div>'
}
var linkrenderer_TaskStatus = function (row, column, value) {
return linkrenderStatus('jqxgrid', row, column, value);
}
function linkrenderStatus(jqxGridID, row, column, value) {
var rowdata = $('#' + jqxGridID).jqxGrid('getrowdata', row);
var lnkTskStatus = "";
if (rowdata != null) {
StrTaskId = rowdata.ProjectID;
StrTaskName = JSON.stringify(rowdata.TaskName);
stsTask = JSON.stringify(rowdata.Status.replace(/'/g, '"'));
lnkTskStatus = "<a target='_blank' style='width:100%;text-align: center; margin-top:5px' onclick='getTaskInfo( " + rowdata.ProjectID + "," + rowdata.TaskID + "," + stsTask + "," + StrTaskName + ")'>" + rowdata.Status + "</a>";
}
return '<div style="text-align:center; margin-top: 5px; ">' + lnkTskStatus + '</div>'
}
var linkrenderer_Task = function (row, column, value) {
return linkrender('jqxgrid', row, column, value);
}
function linkrender(jqxGridID, row, column, value) {
var rowdata = $('#' + jqxGridID).jqxGrid('getrowdata', row);
var Tasklink = "";
if (rowdata != null) {
//OpenModalDialog('Alerg',rowdata.ProjectID, '80%', '20%');
StrTaskId = rowdata.ProjectID;
StrTaskName = JSON.stringify(rowdata.TaskName.replace(/'/g, '"'));
stsTask = JSON.stringify(rowdata.Status);
Tasklink = "<a target='_blank' href='javascript:void(0)' style='width:100%' onclick='getTaskInfo( " + rowdata.ProjectID + "," + rowdata.TaskID + "," + stsTask + "," + StrTaskName + ")'>" + rowdata.TaskID + "</a>";
}
return '<div style="text-align:center; margin-top: 5px; ">' + Tasklink + '</div>'
}
// var theme = prepareSimulator("jqxgrid");
var dataAdapter = new $.jqx.dataAdapter(source);
$("#jqxgrid").jqxGrid(
{
width: "95%",
source: dataAdapter,
selectionmode: 'singlecell',
enablebrowserselection: true, //Enables to copy text from the grid.
enabletooltips: true,
autorowheight: true,
autoheight: true,
columnsheight: 40,
pagesize: 20,
pageable: true,
rowsheight: 34,
pagermode: 'simple',
columns: [
{ text: 'TaskID', dataField: 'TaskID', cellsrenderer: linkrenderer_Task, width: "20%", height: "25%", cellsalign: 'center', renderer: columnrenderer },
{ text: 'TaskName', dataField: 'TaskName', width: "50%", height: "25%", cellsrenderer: linkrenderer_TaskName, cellsalign: 'center', renderer: columnrenderer },
{ text: 'Status', dataField: 'Status', width: "30%", height: "25%", cellsrenderer: linkrenderer_TaskStatus, cellsalign: 'center', renderer: columnrenderer }
//{ text: 'Quantity', dataField: 'quantity', width: "15%", cellsalign: 'right' },
//{ text: 'Unit Price', dataField: 'price', width: "15%", cellsalign: 'right', cellsformat: 'c2' },
//{ text: 'Total', dataField: 'total', cellsalign: 'right', minwidth: "15%", cellsformat: 'c2' }
]
});
// initSimulator("jqxgrid");
// $('#contenttablejqxgrid').css('overflow', 'auto');
LodingImage('Hide');
$("#jqxgrid").jqxGrid('refresh');
if (screen == 768) {
$('#jqxgrid').jqxGrid({ pagesize: 20 });
} else {
$('#jqxgrid').jqxGrid({ pagesize: 8 });
}
});
}
catch (ex) {
// navigator.notification.alert(ex + ex.lineNumber + 'ramakrishna', '', 'Alert', 'OK');
alert(ex);
}