jQWidgets Forums
jQuery UI Widgets › Forums › General Discussions › Error in sample Code: Cannot read property ‘msie’ of undefined
Tagged: jquery19, jqwidgets, jqwidgets261
This topic contains 8 replies, has 3 voices, and was last updated by Robin Kluth 12 years, 4 months ago.
-
Author
-
Hello there,
i am using your widget and getting started, but i can’t finish my first code because i caught an error in javascript.
here is my example code:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”><head>
<script type=”text/javascript” src=”jquery/jquery.js”></script>
<link rel=”stylesheet” href=”jqx/jqwidgets/styles/jqx.darkblue.css” type=”text/css” /><script type=”text/javascript” src=”jqx/jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxdata.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxbuttons.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxscrollbar.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxmenu.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxlistbox.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxdropdownlist.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxgrid.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxgrid.selection.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxgrid.columnsresize.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxgrid.filter.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxgrid.sort.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxgrid.pager.js”></script>
<script type=”text/javascript” src=”jqx/jqwidgets/jqxgrid.grouping.js”></script>
<meta content=”text/html; charset=utf-8″ http-equiv=”Content-Type” />
<title>Dokumente Prototyp</title>
</head>
<body>
<h1>Example1</h1>
<div id=”divContent”>
<div id=’jqxWidget’ style=”font-size: 13px; font-family: Verdana; float: left;”>
<div id=”jqxgrid”></div>
</div>
</div><script type=”text/javascript” >
$(document).ready(function () {
// prepare the data
var data = new Array();
var firstNames =
[
“Andrew”, “Nancy”, “Shelley”, “Regina”, “Yoshi”, “Antoni”, “Mayumi”, “Ian”, “Peter”, “Lars”, “Petra”, “Martin”, “Sven”, “Elio”, “Beate”, “Cheryl”, “Michael”, “Guylene”
];
var lastNames =
[
“Fuller”, “Davolio”, “Burke”, “Murphy”, “Nagase”, “Saavedra”, “Ohno”, “Devling”, “Wilson”, “Peterson”, “Winkler”, “Bein”, “Petersen”, “Rossi”, “Vileid”, “Saylor”, “Bjorn”, “Nodier”
];
var productNames =
[
“Black Tea”, “Green Tea”, “Caffe Espresso”, “Doubleshot Espresso”, “Caffe Latte”, “White Chocolate Mocha”, “Cramel Latte”, “Caffe Americano”, “Cappuccino”, “Espresso Truffle”, “Espresso con Panna”, “Peppermint Mocha Twist”
];
var priceValues =
[
“2.25”, “1.5”, “3.0”, “3.3”, “4.5”, “3.6”, “3.8”, “2.5”, “5.0”, “1.75”, “3.25”, “4.0”
];
for (var i = 0; i < 1000; i++) {
var row = {};
var productindex = Math.floor(Math.random() * productNames.length);
var price = parseFloat(priceValues[productindex]);
var quantity = 1 + Math.round(Math.random() * 10);
row[“firstname”] = firstNames[Math.floor(Math.random() * firstNames.length)];
row[“lastname”] = lastNames[Math.floor(Math.random() * lastNames.length)];
row[“productname”] = productNames[productindex];
row[“price”] = price;
row[“quantity”] = quantity;
row[“total”] = price * quantity;
data[i] = row;
}
var source =
{
localdata: data,
datatype: “array”
};
var dataAdapter = new $.jqx.dataAdapter(source, {
loadComplete: function (data) { },
loadError: function (xhr, status, error) { }
});
$(“#jqxgrid”).jqxGrid(
{
source: dataAdapter,
columns: [
{ text: ‘First Name’, datafield: ‘firstname’, width: 100 },
{ text: ‘Last Name’, datafield: ‘lastname’, width: 100 },
{ text: ‘Product’, datafield: ‘productname’, width: 180 },
{ text: ‘Quantity’, datafield: ‘quantity’, width: 80, cellsalign: ‘right’ },
{ text: ‘Unit Price’, datafield: ‘price’, width: 90, cellsalign: ‘right’, cellsformat: ‘c2’ },
{ text: ‘Total’, datafield: ‘total’, width: 100, cellsalign: ‘right’, cellsformat: ‘c2’ }
]
});
});
</script>
</body></html>
thanks in advance for your help,
best regards
Ipad
Hi, jQuery 1.9 will be supported in jQWidgets 2.7.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comit is jquery 1.9.0, which is embedded in the frist line after the “head”-tag
best Regards,
IpadjQWidgets currently supports jQuery versions from 1.6 to 1.8.3. jQuery 1.9 support will be available in the first half of February.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comAh, okay! I missunderstand u, now its working really fine!
Thank you!Best Regards,
IpadHi Ipad,
We recently released jQWidgets 2.6.1 which supports jQuery 1.9.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com@Peter Stoev: The latest package misses jquery-1.9.min.js (latest jQuery version shipped with that package was 1.8.2). You linked to 1.9 in the Main-Page example, so it seems that you’ve forgot it, right?
Hi Robin Kluth,
The version is compatible with jQuery 1.9 and that is important. If you want to download jQuery 1.9, visit: http://jquery.com.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comOkay, I thought you wanted to ship jQuery 1.9 with the jQX 2.6.1-package (because you linked to it on the download-page:
<!-- add the jQuery script --> <script type="text/javascript" src="scripts/jquery-1.9.0.min.js"></script>
-
AuthorPosts
You must be logged in to reply to this topic.