Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
0
IgGrid checkbox is not getting checked on first click on IOS Version 13.2.2
posted

IgGrid checkbox is not getting checked on the first click as it is accepting double clicks to get checked on IOS Version 13.2.2 and after

disabling the virtualization the checkbox gets checked on the first click but taking more time. any solution would be appreciated. below is the code I have used to populate the grid. 

var varheight = "600px"
var varVirtualization = true;
var virtualizationMode = "continuous"

if (varIsVirtualization == "0") {

varheight = null;
varVirtualization = false;
virtualizationMode = null;
}

var isHeader = false;
var isFiredFromCheckbox = false;
var canSelectRow = false;
var selectedRows = null;
var fromSelection = false;

$("#grid").igGrid({
autoGenerateColumns: false,
dataSource: gridList, //Ajax JSON returns array of objects
renderCheckBoxes: true,
height: varheight,
avgRowHeight: 25,
width: "100%",
//virtualization: true,
virtualization: varVirtualization,
virtualizationMode: virtualizationMode,
primaryKey: "poNumber",
rendered: function (evt, ui) {
if (document.getElementById("HiddenShowPricing").value == "false")
$("#grid").igGridHiding("hideColumn", 'amount');

//zshams - 13Nov15 - hiding the header checkbox
$("#" + ui.owner.element.prop("id") + "_headers > thead > tr > th.ui-iggrid-rowselector-header").find("span[data-role='checkbox']").css("display", "none");
$("#" + ui.owner.element.prop("id") + " > thead > tr > th.ui-iggrid-rowselector-header").find("span[data-role='checkbox']").css("display", "none");
},
cellClick: function (evt, ui) {
var rowId = ui.rowKey;
var found = false;
if ((ui.colKey == "poNumber" || ui.colKey == "jobDisplay" || ui.colKey == "schDisplayCurrent" || ui.colKey == "schDisplayComplete" || ui.colKey == "vendorName") && (fromSelection == true)) {

for (i = 0; i < selectedRows.length; i++) {
if (selectedRows[i].id === rowId) {
$("#grid").igGridSelection("selectRowById", rowId);
found = true;
//zshams - 31Aug15 storing the current record's id (SLX 102-08-3-1920)
lastSelectedRecord = $($("#grid").igGrid("rowById", rowId)).attr("data-row-idx");
}
}

if (found == false) {
$("#grid").igGridSelection("deselectRowById", rowId);
//zshams - 31Aug15 storing the current record's id (SLX 102-08-3-1920)
lastSelectedRecord = $($("#grid").igGrid("rowById", rowId)).attr("data-row-idx");
}
}
if ((ui.colKey == "poNumber" || ui.colKey == "jobDisplay" || ui.colKey == "schDisplayCurrent" || ui.colKey == "schDisplayComplete" || ui.colKey == "vendorName") && (fromSelection == false)) {

selectedRows = $("#grid").igGrid("selectedRows");
for (i = 0; i < selectedRows.length; i++) {
if (selectedRows[i].id === rowId) {
$("#grid").igGridSelection("selectRowById", rowId);
found = true;
//zshams - 31Aug15 storing the current record's id (SLX 102-08-3-1920)
lastSelectedRecord = $($("#grid").igGrid("rowById", rowId)).attr("data-row-idx");
}
}
if (found == false) {
$("#grid").igGridSelection("deselectRowById", rowId);
//zshams - 31Aug15 storing the current record's id (SLX 102-08-3-1920)
lastSelectedRecord = $($("#grid").igGrid("rowById", rowId)).attr("data-row-idx");
}
}

/*Added SLX: 001-00-3-21988*/
if (document.getElementById("HiddenIsMobile").value == "True" && fromSelection == true) {
$("#grid").igGridSelection("deselectRowById", rowId);
lastSelectedRecord = $($("#grid").igGrid("rowById", rowId)).attr("data-row-idx");
}
/*Addition Ended SLX: 001-00-3-21988*/

fromSelection = false;
},
columns: [
{ key: "projectID", dataType: "string", allowHiding: false, hidden: true },
{ key: "buildingID", dataType: "string", allowHiding: false, hidden: true },
{ key: "unitID", dataType: "string", allowHiding: false, hidden: true },
{ key: "vendorID", dataType: "string", allowHiding: false, hidden: true },
{ key: "vendorAlphaSort", dataType: "string", allowHiding: false, hidden: true },
{ key: "userID", dataType: "string", allowHiding: false, hidden: true },
{ key: "schCurrent", dataType: "date", format: "MM/dd/yyyy", allowHiding: false, hidden: true },
{ key: "schComplete", dataType: "date", format: "MM/dd/yyyy", allowHiding: false, hidden: true },
{ key: "allowScheduleChange", dataType: "string", allowHiding: false, hidden: true },
{ key: "jobAddress", dataType: "string", allowHiding: false, hidden: true },
{ key: "canEditMPO", dataType: "bool", allowHiding: false, hidden: true },
{ key: "canViewMPO", dataType: "bool", allowHiding: false, hidden: true },
{ key: "canReassignPO", dataType: "bool", allowHiding: false, hidden: true },
{ key: "pendingAction", dataType: "string", allowHiding: false, hidden: true },
{ key: "isFlagged", dataType: "bool", allowHiding: false, hidden: true },
{ key: "isFlagNote", dataType: "bool", allowHiding: false, hidden: true },
{ key: "vendorContact", dataType: "string", allowHiding: false, hidden: true },
{ key: "vendorAddr1", dataType: "string", allowHiding: false, hidden: true },
{ key: "vendorAddr2", dataType: "string", allowHiding: false, hidden: true },
{ key: "vendorPhone", dataType: "string", allowHiding: false, hidden: true },
{ key: "vendorFax", dataType: "string", allowHiding: false, hidden: true },
{ key: "vendorEmail", dataType: "string", allowHiding: false, hidden: true },
{ key: "flagID", dataType: "string", allowHiding: false, hidden: true },
{ key: "printPO", dataType: "string", allowHiding: false, hidden: true },
{ key: "jobID", dataType: "string", allowHiding: false, hidden: true },
{ key: "companyID", dataType: "string", allowHiding: false, hidden: true },
{ key: "allowApprove", dataType: "string", allowHiding: false, hidden: true },
{ key: "canVariance", dataType: "bool", allowHiding: false, hidden: true },
{ key: "isComplete", dataType: "bool", allowHiding: false, hidden: true },
{ key: "canPoApproveForVendor", dataType: "string", allowHiding: false, hidden: true },
{ key: "flagNote", dataType: "string", allowHiding: false, hidden: true },
{ key: "emailed_po_number", dataType: "string", allowHiding: false, hidden: true },
{ key: "emailed_po_datetime", dataType: "string", allowHiding: false, hidden: true },
{ key: "UnReadMsgCount", dataType: "string", allowHiding: false, hidden: true },
{ key: "project_work_days", dataType: "string", allowHiding: false, hidden: true },

{ headerText: "Action - Status", width: colGlobalActionStatusWidth, key: "actionStatus", unbound: true, formatter: GetActionStatus },
{ headerText: "Owner", width: colGlobalOwnerWidth, key: "poActedOnByName", dataType: "string" },
{ headerText: "PO", width: colGlobalVPO_POWidth, key: "poNumber", dataType: "string", template: '<a href=\'RunReport.aspx?ReportName=Invoiced Purchase Order&po_number_low=${poNumber}&po_number_high=${poNumber}&user_id_=${userID}&company_id_=${companyID}\'>${poNumber}</a>', hidden: false },
{ headerText: "Age", width: colGlobalAgeWidth, key: "age", dataType: "number" },
{ headerText: "Job", width: colGlobalJobWidth, key: "jobDisplay", dataType: "string", template: '<a href=\'javascript:void();\' ontouchend="showJobInfo(\'${projectID}\', \'${buildingID}\', \'${unitID}\');return false;" onclick="showJobInfo(\'${projectID}\', \'${buildingID}\', \'${unitID}\');return false;">${jobDisplay}</a>', hidden: false },
//{ headerText: "Job", width: "10%", key: "jobID", dataType: "string", template: '<a href=\'jobinfo_ignite.aspx?project_id_=${projectID}&building_id_=${buildingID}&unit_id_=${unitID}\' onclick=\'jobPopup(this.href, "jobinfo");return false;\'>${jobDisplay}</a>', hidden: false },
{ headerText: "Actv", width: colGlobalActvWidth, key: "activityNo", dataType: "string" },
{ headerText: "Activity Name", width: colGlobalActivityNameWidth, key: "activityName", dataType: "string" },
{ headerText: "Vendor", width: colGlobalVendorWidth, key: "vendorName", dataType: "string", unbound: false, formatter: SetEmailDialog },
// { headerText: "Vendor Email", width: colGlobalVendEmailWidth, key: "vendorEmail", dataType: "string" },
{ headerText: "Amount", width: colGlobalAmountWidth, key: "amount", dataType: "number", format: "currency" },
{ headerText: "Start", width: colGlobalStartWidth, key: "schDisplayCurrent", dataType: "date", format: "MM/dd/yyyy", unbound: true, template: $("#actvStartDateTmpl").html(), formula: GetStartDate },
{ headerText: "Complete", width: colGlobalCompleteWidth, key: "schDisplayComplete", dataType: "date", format: "MM/dd/yyyy", unbound: true, template: $("#actvEndDateTmpl").html(), formula: GetEndDate },
{ headerText: "Dur", width: colGlobalDurWidth, key: "duration", dataType: "string" }
],
features: [

{
name: 'Hiding',
columnSettings: [
{ columnKey: "projectID", allowHiding: false },
{ columnKey: "buildingID", allowHiding: false },
{ columnKey: "unitID", allowHiding: false },
{ columnKey: "vendorID", allowHiding: false },
{ columnKey: "vendorAlphaSort", allowHiding: false },
{ columnKey: "vendorName", allowHiding: false },
{ columnKey: "userID", allowHiding: false },
{ columnKey: "schCurrent", allowHiding: false },
{ columnKey: "schComplete", allowHiding: false },
{ columnKey: "poNumber", allowHiding: false },
{ columnKey: "allowScheduleChange", allowHiding: false },
{ columnKey: "jobID", allowHiding: false },
{ columnKey: "jobAddress", allowHiding: false },
{ columnKey: "activityNo", allowHiding: false },
{ columnKey: "activityName", allowHiding: false },
{ columnKey: "schDisplayCurrent", allowHiding: false },
{ columnKey: "schDisplayComplete", allowHiding: false },
{ columnKey: "duration", allowHiding: false },
{ columnKey: "age", allowHiding: false },
{ columnKey: "amount", allowHiding: false },
{ columnKey: "canEditMPO", allowHiding: false },
{ columnKey: "canViewMPO", allowHiding: false },
{ columnKey: "canReassignPO", allowHiding: false },
{ columnKey: "pendingAction", allowHiding: false },
{ columnKey: "isFlagged", allowHiding: false },
{ columnKey: "isFlagNote", allowHiding: false },
{ columnKey: "poActedOnByName", allowHiding: false },
{ columnKey: "vendorContact", allowHiding: false },
{ columnKey: "vendorAddr1", allowHiding: false },
{ columnKey: "vendorAddr2", allowHiding: false },
{ columnKey: "vendorPhone", allowHiding: false },
{ columnKey: "vendorFax", allowHiding: false },
{ columnKey: "vendorEmail", allowHiding: false },
{ columnKey: "flagID", allowHiding: false },
{ columnKey: "printPO", allowHiding: false },
{ columnKey: "companyID", allowHiding: false },
{ columnKey: "jobDisplay", allowHiding: false },
{ columnKey: "allowApprove", allowHiding: false },
{ columnKey: "canVariance", allowHiding: false },
{ columnKey: "isComplete", allowHiding: false },
{ columnKey: "actionStatus", allowHiding: false },
{ columnKey: "canPoApproveForVendor", allowHiding: false },
{ columnKey: "flagNote", allowHiding: false },
{ columnKey: "emailed_po_number", allowHiding: false },
{ columnKey: "emailed_po_datetime", allowHiding: false },
{ columnKey: "UnReadMsgCount", allowHiding: false }]
},
{
name: 'Tooltips',
visibility: 'always',
showDelay: 1000,
hideDelay: 500,
tooltipShowing: function (evt, ui) {

var rowPONumber = $(ui.element).parent().attr("data-id"); //$($("#grid").igGrid("rowAt", ui.index)).attr("data-id");
var rowData = $("#grid").igGrid("findRecordByKey", rowPONumber);

switch (ui.columnKey) {
case "vendorName":
var contact = rowData.vendorContact;
var addr1 = rowData.vendorAddr1;
var addr2 = rowData.vendorAddr2;
var phone = rowData.vendorPhone;
var fax = rowData.vendorFax;
var email = rowData.vendorEmail;

ui.tooltip = contact + "\n"
+ addr1 + "\n"
if (addr2 != "")
{
ui.tooltip = ui.tooltip + addr2 + "\n"
}

ui.tooltip = ui.tooltip
+ " Phone: " + phone + "\n"
+ " Fax: " + fax + "\n"
+ " Email: " + email;
break;

case "canVariance":
ui.tooltip = "Create a Variance Request for PO " + rowPONumber;
break;

default:
var jobID = rowData.projectID + '/' + rowData.buildingID + '/' + rowData.unitID;
var jobAddress = rowData.jobAddress;
var actvName = rowData.activityName;
var actvNo = rowData.activityNo;
var vendName = rowData.vendorName;
var alphaSort = rowData.vendorAlphaSort;
var vendorID = rowData.vendorID;


ui.tooltip = jobID + " " + jobAddress + " " + actvName + " (" + actvNo + ") " + vendName + " (" + vendorID + ") ";
}

},
tooltipShown: function (evt, ui) {
$("#grid_tooltips").css("width", "20%");
$("#grid_tooltips").css("max-width", "50%");
$("#grid_tooltips").css("word-wrap", "normal");
$("#grid_tooltips").css("white-space", "pre-wrap");
}
},
{
name: 'Resizing'
},
{
name: "GroupBy",
type: "local",
initialExpand: false,
columnSettings: [
{ columnKey: "projectID", allowGrouping: false },
{ columnKey: "buildingID", allowGrouping: false },
{ columnKey: "unitID", allowGrouping: false },
{ columnKey: "vendorID", allowGrouping: false },
{ columnKey: "vendorAlphaSort", allowGrouping: false },
{ columnKey: "jobAddress", allowGrouping: false },
{ columnKey: "userID", allowGrouping: false },
{ columnKey: "schCurrent", allowGrouping: false },
{ columnKey: "schComplete", allowGrouping: false },
{ columnKey: "poNumber", allowGrouping: false },
{ columnKey: "allowScheduleChange", allowGrouping: false },
{ columnKey: "canEditMPO", allowGrouping: false },
{ columnKey: "canViewMPO", allowGrouping: false },
{ columnKey: "canReassignPO", allowGrouping: false },
{ columnKey: "pendingAction", allowGrouping: false },
{ columnKey: "isFlagged", allowGrouping: false },
{ columnKey: "isFlagNote", allowGrouping: false },
{ columnKey: "vendorContact", allowGrouping: false },
{ columnKey: "vendorAddr1", allowGrouping: false },
{ columnKey: "vendorAddr2", allowGrouping: false },
{ columnKey: "vendorPhone", allowGrouping: false },
{ columnKey: "vendorFax", allowGrouping: false },
{ columnKey: "vendorEmail", allowGrouping: false },
{ columnKey: "flagID", allowGrouping: false },
{ columnKey: "printPO", allowGrouping: false },
{ columnKey: "companyID", allowGrouping: false },
{ columnKey: "allowApprove", allowGrouping: false },
{ columnKey: "canVariance", allowGrouping: false },
{ columnKey: "actionStatus", allowGrouping: false },
{ columnKey: "isComplete", allowGrouping: false },
{ columnKey: "canPoApproveForVendor", allowGrouping: false },
{ columnKey: "flagNote", allowGrouping: false },
{ columnKey: "emailed_po_number", allowGrouping: false },
{ columnKey: "emailed_po_datetime", allowGrouping: false },
{ columnKey: "UnReadMsgCount", allowGrouping: false }
]
},

{
name: 'Selection',
mode: 'row',
multipleSelection: true,
activation: true,
touchDragSelect: true,
rowSelectionChanging: function (evt, ui) {
if (!isHeader) {
var rowId = ui.row.id;
selectedRows = ui.selectedRows;
if (isFiredFromCheckbox)
fromSelection = false;
else
fromSelection = true;
isFiredFromCheckbox = false;

for (i = 0; i < selectedRows.length; i++) {
if (selectedRows[i].id === rowId) {
evt.preventDefault();
//if(isFiredFromCheckbox==false)
$("#grid").igGridSelection("deselectRowById", rowId);
//zshams - 31Aug15 storing the current record's id (SLX 102-08-3-1920)
lastSelectedRecord = $($("#grid").igGrid("rowById", rowId)).attr("data-row-idx");
return;
}
}
evt.preventDefault();
$("#grid").igGridSelection("selectRowById", rowId);
//zshams - 31Aug15 storing the current record's id (SLX 102-08-3-1920)
lastSelectedRecord = $($("#grid").igGrid("rowById", rowId)).attr("data-row-idx");

/*Added SLX: 001-00-3-21988*/
if (document.getElementById("HiddenIsMobile").value == "True" && fromSelection == true) {
$("#grid").igGridSelection("deselectRowById", rowId);
lastSelectedRecord = $($("#grid").igGrid("rowById", rowId)).attr("data-row-idx");
}
/*Addition Ended SLX: 001-00-3-21988*/
}
else {
isHeader = false;
isFiredFromCheckbox = false;
}
}
}, {
name: 'RowSelectors',
enableCheckBoxes: true, checkBoxStateChanging: function (evt, args) {
isFiredFromCheckbox = true;
if (args.isHeader)
isHeader = true;
else
isHeader = false;
},
},

{
name: "Sorting",
type: "local",
mode: "single",
sortingDialogContainment: "window",
columnSettings: [
{ columnKey: "jobDisplay", allowSorting: true },
{ columnKey: "canVariance", allowSorting: false },
{ columnKey: "allowApprove", allowSorting: false },
{ columnKey: "actionStatus", allowSorting: false },
{ columnKey: "canPoApproveForVendor", allowSorting: false },
{ columnKey: "flagNote", allowSorting: false },
{ columnKey: "emailed_po_number", allowSorting: false },
{ columnKey: "emailed_po_datetime", allowSorting: false },
{ columnKey: "UnReadMsgCount", allowSorting: false }]
}, {
name: "ColumnMoving",
columnMovingDialogContainment: "window",
columnSettings: [
{ columnKey: "jobDisplay", allowMoving: true },
{ columnKey: "allowApprove", allowMoving: false },
{ columnKey: "canVariance", allowMoving: false },
{ columnKey: "actionStatus", allowMoving: false },
{ columnKey: "canPoApproveForVendor", allowMoving: false },
{ columnKey: "flagNote", allowMoving: false },
{ columnKey: "emailed_po_number", allowMoving: false },
{ columnKey: "emailed_po_datetime", allowMoving: false },
{ columnKey: "UnReadMsgCount", allowMoving: false }]
}, {
name: "Filtering",
type: "local",
mode: "advanced",
renderFC: false,
renderFilterButton: false
}]
});