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
35
Got "Uncaught TypeError: Cannot read property 'template' of undefined" when click checkbox column.
posted

I got an error after run following code and follow these steps(in Chrome Version 47.0.2526.106 m).

-Checked a checkbox in first row.

-Click checkbox in second row.

-In console there an error "Uncaught TypeError: Cannot read property 'template' of undefined".

<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<link href="http://cdn-na.infragistics.com/igniteui/2015.2/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
<link href="http://cdn-na.infragistics.com/igniteui/2015.2/latest/css/structure/infragistics.css" rel="stylesheet" />
<link href="http://www.igniteui.com/css/bootstrap/bootstrap.min.css" rel="stylesheet" />

<script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>

<!-- Ignite UI Required Combined JavaScript Files -->
<script src="http://cdn-na.infragistics.com/igniteui/2015.2/latest/js/infragistics.core.js"></script>
<script src="http://cdn-na.infragistics.com/igniteui/2015.2/latest/js/infragistics.lob.js"></script>
<script>
var lineItems = [];
function initLineItemGrid() {
var deferred = $.Deferred();
var options = {
dataSource: lineItems,
width: "1400px",
height: "300px",
primaryKey: 'Id',
virtualizationMode: "continuous",
rowVirtualization: true,
renderCheckboxes :true,
columnVirtualization: false,
virtaulization: false,
avgRowHeight: "25px",
autoCommit: true,
autoGenerateColumns: false,
columns: [
{ key: "Id", headerText: "Id", width: "10px", dataType: "string", hidden: true },
{ key: "IsSelected", headerText: "?", width: "50px", dataType: "bool",cellTemplate:"" },
{ key: "Val1", headerText: "Val1", width: "100px", dataType: "string" },
{ key: "Val2", headerText: "Val2", width: "200px", dataType: "string" },
{ key: "Val3", headerText: "Val3", width: "100px", dataType: "string" }
],
features: [
{
name: "Updating",
enableAddRow: false,
enableDeleteRow: false,
editMode: "cell",
columnSettings: [
{ columnKey: "Id", readOnly: true },
{ columnKey: "Val1", readOnly: true }
]
}
],
rendered: function () {
deferred.resolve();
}
};
$("#tblLineItems").igGrid(options);
return deferred.promise();
}

$(function () {
initLineItemGrid()
.done(function () {
lineItems.push({ Id: "111", Val1: "aaa1", Val2: "bbb", Val3: "ccc", IsSelected: false });
lineItems.push({ Id: "222", Val1: "aaa2", Val2: "bbb", Val3: "ccc", IsSelected: false });
lineItems.push({ Id: "333", Val1: "aaa3", Val2: "bbb", Val3: "ccc", IsSelected: false });
$("#tblLineItems").igGrid("dataBind");
});
});
</script>
</head>
<body>
<div id="main">
<div class="row">
<table id="tblLineItems"></table>
</div>
</div>
</body>
</html>

  • 17590
    Offline posted

    Hello Jassada,

    Thank you for posting in our forum.

    I created the following case for you: CAS-168536-Q0D8P1 and I will update you thought it. You could see it in your account in the "Support Activity" page.

    Please let me know if you need any additional information.

  • 22852
    Offline posted

    The fix for development issue 212197 which was logged for this Uncaught TypeError is available in the latest service release which can be downloaded from the My Keys and Downloads page.