PDA

View Full Version : gridPanel shows data from REST service in IE but not in Firefox



mirceat
13 Jan 2010, 10:46 AM
Hi,

I'm new to Ext JS and have the problem in the subject. The REST service is from a CouchDB database that returns as below. Thanks for your help.

Cheers,
Mircea



{"rows":[
{"key":"companies","value":30448},
{"key":"financial organizations","value":3450},
{"key":"people","value":40000},
{"key":"products","value":11841},
{"key":"service providers","value":1991}
]}


<!DOCTYPE html>
<html>
<head>
<title>Generated CouchApp</title>
<link rel="stylesheet" href="style/main.css" type="text/css">
<link rel="stylesheet" type="text/css" href="lib/ext/resources/css/ext-all.css" />
<script src="lib/ext/adapter/ext/ext-base.js">
</script>
<script src="lib/ext/ext-all-debug.js">
</script>
<script>
Ext.onReady(function(){
// add your data store here
var store = new Ext.data.Store({
url: 'http://127.0.0.1:5984/entities/_design/process/_view/listCategories?group_level=1',
reader: new Ext.data.JsonReader({
root: 'rows',
id: 'key'
}, ['key', {
name: 'value',
type: 'int'
}])
});
store.load();

var grid = new Ext.grid.GridPanel({
renderTo: document.body,
frame: true,
title: 'Categories',
height: 200,
width: 500,
store: store,
columns: [{
header: "Name",
dataIndex: 'key'
}, {
header: "Count",
dataIndex: 'value'
}]
});
})
</script>
</head>
<body>
</body>
<script src="/_utils/script/json2.js">
</script>
<script src="/_utils/script/jquery.js?1.3.1">
</script>
<script src="/_utils/script/jquery.couch.js?0.9.0">
</script>
</html>

Sgt.Pepper
26 Feb 2010, 3:02 AM
Trace the request and the response with firebug. Does the response arrive correctly?