View Full Version : [OPEN-1337] PivotGrid Axis doesn't display when using local data

14 Oct 2010, 11:47 AM
Upon investigating the use of the PivotGrid found that if you use the "data" config of the store to have it use local data the PivotGrid will not display the leftAxis or topAxis. If you use the url feature like in the examples it works fine.

Excerpt from the PivotGrid example (People)

//var people = { <Contents of people.json directly assigned here too big to post with thread> };

var myStore = new Ext.data.Store({
url: 'people.json', // This config option works and displays the axis
//data: people, // This option will display the data has configured with the aggregator but will not display axis
autoLoad: true,
reader: new Ext.data.JsonReader({
root: 'rows',
idProperty: 'id'
}, PersonRecord)

14 Oct 2010, 12:29 PM
are you sure the data is loaded? Does your "people" object contain a "rows" array?

14 Oct 2010, 12:40 PM
yes the data is in the tables. Please see the attached screenshot images

14 Oct 2010, 12:44 PM
very strange. I'm not too sure this is a bug yet.

can you reproduce this with the example?

14 Oct 2010, 12:48 PM
I am producing it with the examples. I am using the people example under the pivotgrid example folder. I have just taken the people.json file and just assigned its contents to a local variable in the people.js file and then assigned the store to use the "data" config and assign it to use that local variable that now holds the JSON. And then when you load the page it will not render the axis. If you just use the configured "url: 'people.json'" then it works fine.

14 Oct 2010, 12:58 PM
I just tried something else and now it displays the axis headers. Still using the local data.... Instead of using the "data: people" like before directly on the store I tried
myStore.loadData(people); and everything displays correctly now.

Kind of odd.

30 Oct 2010, 6:53 AM
I have run into exactly the same issue. I tried to do store.LoadData(data)/ But it still doesn't work. I see the tha data in the grid but I don't see the axis. It works only when I use the url config. Please help.......

17 Dec 2010, 6:42 AM
I reported this bug today.
You have to call loadData, after the store is already added to the grid to trigger the ondatachange gridview's event.
Or you can manually call grid.view.refresh(true) to render the row/col headers.

12 Feb 2011, 12:51 PM
Does anyone have a working example that uses local data?

16 Feb 2011, 2:56 AM
Call grid.view.refresh(true) manually after grid creation.