PDA

View Full Version : How to change the exam code to che code which I can use in myeclipse



sophia2009s
7 Nov 2010, 5:48 AM
the examcode is as following:
/*!
* Ext JS Library 3.3.0
* Copyright(c) 2006-2010 Ext JS, Inc.
* [email protected]
* http://www.extjs.com/license
*/
/**
* Multiple PivotGrid examples. Each PivotGrid shares a common Record and Store and simply presents
* the data in a different way. For full details on using PivotGrid see the API documentation.
*/
Ext.onReady(function() {
var PersonRecord = Ext.data.Record.create([
{name: 'eyeColor', type: 'string'},
{name: 'birthDecade', type: 'string'},
{name: 'handedness', type: 'string'},
{name: 'gender', type: 'string'},
{name: 'height', type: 'int'},
{name: 'iq', type: 'int'}
]);

var myStore = new Ext.data.Store({
url: 'people.json',
autoLoad: true,
reader: new Ext.data.JsonReader({
root: 'rows',
idProperty: 'id'
}, PersonRecord)
});

var averageHeight = new Ext.grid.PivotGrid({
title : 'Average height',
width : 600,
height : 154,
renderTo : 'avgHeight',
store : myStore,
aggregator: 'avg',
measure : 'height',

//turns a decimal number of feet into feet and inches
renderer : function(value) {
var feet = Math.floor(value),
inches = Math.round((value - feet) * 12);

return String.format("{0}' {1}\"", feet, inches);
},

leftAxis: [
{
width: 80,
dataIndex: 'birthDecade'
}
],

topAxis: [
{
dataIndex: 'gender'
},
{
dataIndex: 'handedness'
}
]
});

var perDecade = new Ext.grid.PivotGrid({
title : 'Number of people born per decade',
width : 600,
height : 91,
renderTo : 'perDecade',
store : myStore,
aggregator: 'count',

topAxis: [
{
width: 80,
dataIndex: 'birthDecade'
}
],

leftAxis: [
{
dataIndex: 'gender'
}
]
});

var maxIQ = new Ext.grid.PivotGrid({
title : 'Max IQ per decade',
width : 600,
height : 91,
renderTo : 'maxIQ',
store : myStore,
measure : 'iq',
aggregator: 'max',

topAxis: [
{
width: 80,
dataIndex: 'birthDecade'
},
{
dataIndex: 'handedness'
}
]
});
});
and the panel ishttp://dev.sencha.com/deploy/ext-3.3.0/examples/pivotgrid/people.html

I'm looking forward to your help,thank you!
<html xmlns="http://www.w3.org/1999/xhtml"><body xmlns="http://www.w3.org/1999/xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><img width='77' height='5' src='chrome://livemargins/skin/monitor-background-horizontal.png' style='position: absolute;left:-77px;top:-5px'/> <img src='chrome://livemargins/skin/monitor-background-vertical.png' style='position: absolute;left:0;top:-5px;'/> <img id='monitor-play-button' src='chrome://livemargins/skin/monitor-play-button.png' onmouseover='this.style.opacity=1' onmouseout='this.style.opacity=0.5' style='position: absolute;left:1px;top:0;opacity:0.5;cursor:pointer'/>

plalx
7 Nov 2010, 6:18 AM
I don't get the question?

darthwes
7 Nov 2010, 7:22 AM
Is there a question? Can you try to use the forum post tools to put your code inside code brackets (making it possible to be read)? Can you give us a question with some sample code to demonstrate your problem?