This is a migrated thread and some comments may be shown as answers.

Grid not showing data on simple example

2 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Graziano
Top achievements
Rank 1
Graziano asked on 29 Aug 2012, 02:13 PM
Hi there,

i suppose my problem is a very trivial one. In order to test the kendo library I wanted to connect the grid to a json webservice.
When that didn't work I tried it locally as described in the examples, but still couldn't make it work.

Is there something I missed? Or is the data in the wrong format? The error firebug tells me is ocurring in kendo.web.js at line 5469 but i suppose the real problem lies much on a higher level.

here the html:

<!DOCTYPE html>
<html lang="de">
<head>
  <meta charset="utf-8" />
  <title>Kendotest</title>
  <!--[if lt IE 9]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]--> 
  <link href="styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
  <link href="styles/kendo.default.min.css" rel="stylesheet" type="text/css" />
  <link href="styles/kendo.dataviz.min.css" rel="stylesheet" type="text/css" />
  <script src="js/jquery.min.js" type="text/javascript"></script>
  <script src="js/kendo.web.js" type="text/javascript"></script>
  <script src="js/kendo.dataviz.min.js" type="text/javascript"></script>
  <script src="js/main.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<header>
</header>
<section id="content">
<div id="grid">
</div>
</section>
<footer>
</footer>
</div>
</body>
</html>

and the main.js:

$(document).ready(function(){
var dta = [
{Artikel_ID:1,Bezeichnung:"Testartikel",VK_Preis:900},
{Artikel_ID:2,Bezeichnung:"BASEL GEHT AUS!",VK_Preis:24.5},
{Artikel_ID:3,Bezeichnung:null,VK_Preis:24.5},
{Artikel_ID:4,Bezeichnung:null,VK_Preis:24.5},
{Artikel_ID:5,Bezeichnung:"TESSIN GEHT AUS!",VK_Preis:24.5},
{Artikel_ID:6,Bezeichnung:null,VK_Preis:24.5},
{Artikel_ID:7,Bezeichnung:"Versandkosten",VK_Preis:9},
{Artikel_ID:8,Bezeichnung:"Stein der Verdammnis",VK_Preis:42},
{Artikel_ID:9,Bezeichnung:"Stein der Weisen",VK_Preis:163},
{Artikel_ID:10,Bezeichnung:"Feueressenz der Ewigkeit",VK_Preis:43},
{Artikel_ID:11,Bezeichnung:null,VK_Preis:4740.45},
{Artikel_ID:12,Bezeichnung:null,VK_Preis:252},
{Artikel_ID:13,Bezeichnung:"Eisenbarren",VK_Preis:25},
{Artikel_ID:14,Bezeichnung:null,VK_Preis:1248},
{Artikel_ID:15,Bezeichnung:"Foliant der Erkenntnis",VK_Preis:0},
{Artikel_ID:23,Bezeichnung:"Basisplatine 50mm x50mm, gelocht",VK_Preis:0.8},
{Artikel_ID:24,Bezeichnung:"SMD WIDERSTAND 300R 1% 0805",VK_Preis:0.25},
{Artikel_ID:25,Bezeichnung:null,VK_Preis:0.1},
{Artikel_ID:26,Bezeichnung:"WIDERSTAND,500 OHM 5W Typ: MC14712",VK_Preis:0.25},
{Artikel_ID:27,Bezeichnung:"Kondensator Elektrolyt 45uF, 20V",VK_Preis:1.2},
{Artikel_ID:28,Bezeichnung:"STP0021-1 Steuerungsplatine Flugsicherung",VK_Preis:150}
]


var dsArtikel = new kendo.data.DataSource({
data: dta
});
 
 
$("#grid").kendoGrid({
          dataSource: dsArtikel
 });
  });

any idea what I might be doing wrong here?

thanks for your help,

Graziano

2 Answers, 1 is accepted

Sort by
0
Nohinn
Top achievements
Rank 1
answered on 29 Aug 2012, 02:24 PM
Try and change the order of your kendo.web javascript file and the dataviz one, so first would be the dataviz and then kendo.web:
<script src="js/kendo.dataviz.min.js" type="text/javascript"></script>
<script src="js/kendo.web.js" type="text/javascript"></script>

Whenever you want to use both remember to put first the dataviz reference.
0
Graziano
Top achievements
Rank 1
answered on 29 Aug 2012, 02:29 PM
Thanks! That was the Problem


Tags
Grid
Asked by
Graziano
Top achievements
Rank 1
Answers by
Nohinn
Top achievements
Rank 1
Graziano
Top achievements
Rank 1
Share this question
or