Results 1 to 7 of 7

Thread: A bug in Ext.grid.PivotAxis

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Nov 2010

    Default A bug in Ext.grid.PivotAxis

    I found a bug in the method buildHeaders of Ext.grid.PivotAxis. Look at the following code snapshot:

    /* * 'changed' indicates that we need to create a new cell. This should be true whenever the cell * above (previousHeader) is different from this cell, or when the cell on the previous dimension * changed (e.g. if the current dimension is Product and the previous was Person, we need to start * a new cell if Product is the same but Person changed, so we check the previous dimension and tuple) */ changed = previousHeader != undefined && previousHeader != currentHeader; if (i > 0 && j > 0) { changed = changed ||[dimensions[i-1].dataIndex] != tuples[j-1].data[dimensions[i-1].dataIndex]; }
    I think it is not enough just to check previous dimension. Instead all the preceding dimensions should be compared. So my fix is like below:

    isPrecedingChanged : function(tuples,dimensions,currentCol,currentRow){
    var changed = false;
    for(var col= currentCol; col>0; col--){
    changed = true;
    return changed;
    changed = previousHeader !== undefined && previousHeader != currentHeader;
    if (i > 0 && j > 0) {
    changed = changed || me.isPrecedingChanged(tuples,dimensions,i,j);

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL


    Can I get a test case to reproduce an issue?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:

  3. #3
    Sencha User
    Join Date
    Nov 2010

    Default test data

    AA BB CC DD EE FF Estimated Sales Actual Sales
    V1 Shanghai 1 Finance Special Finance Hank 8888 2222
    V2 Beijing 1 Finance Special Finance Adam 7878 111
    V2 Boston 1 Finance Special Finance Adam 3333 4343
    V2 Boston 1 Finance Special Finance Apple 7878 7676

  4. #4
    Sencha User
    Join Date
    Nov 2010

    Default Here comes a testcase

    put following html file in examples\grid folder. you will see misalignment.

    <title>Test Page</title>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type">
    <meta http-equiv="X-UA-Compatible" content="IE=8">
    <!-- EID Theme CSS -->
    <!-- ** CSS ** -->
    <!-- base library -->
    <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />

    <!-- overrides to base library -->

    <!-- page specific -->
    <link rel="stylesheet" type="text/css" href="../shared/examples.css" />
    <link rel="stylesheet" type="text/css" href="grid-examples.css" />

    <!-- ** Javascript ** -->
    <!-- ExtJS library: base/adapter -->
    <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>

    <!-- ExtJS library: all widgets -->
    <script type="text/javascript" src="../../ext-all-debug.js"></script>

    <script type="text/javascript">

    Ext.onReady(function() {
    var SaleRecord =[
    {name: 'D1', type: 'string'},
    {name: 'D2', type: 'string'},
    {name: 'D3', type: 'string'},
    {name: 'D4', type: 'string'},
    {name: 'D5', type: 'string'},
    {name: 'D6', type: 'string'},
    {name: 'D7', type: 'string'},
    {name: 'D8', type: 'string'},
    {name: 'M1', type: 'int'}
    var myData = [
    {"id":"1","D1":"V1","D2":"Shanghai","D3":"1","D4":"Finance","D5":"Special Finance","D6":"Hank","D7":"aa","D8":"d81","M1":"8888"},
    {"id":"2","D1":"V1","D2":"Shanghai","D3":"1","D4":"Finance","D5":"Special Finance","D6":"Hank","D7":"aa","D8":"d80","M1":"8887"},
    {"id":"3","D1":"V1","D2":"Shanghai","D3":"1","D4":"Finance","D5":"Special Finance","D6":"Hank","D7":"aa","D8":"d87","M1":"8886"},
    {"id":"4","D1":"V2","D2":"Beijing","D3":"1","D4":"Finance","D5":"Special Finance","D6":"Adam","D7":"ab","D8":"d86","M1":"7878"},
    {"id":"5","D1":"V2","D2":"Beijing","D3":"1","D4":"Finance","D5":"Special Finance","D6":"Adam","D7":"ac","D8":"d85","M1":"7878"},
    {"id":"6","D1":"V2","D2":"Beijing","D3":"1","D4":"Finance","D5":"Special Finance","D6":"Adam","D7":"ab","D8":"d84","M1":"7878"},
    {"id":"7","D1":"V2","D2":"Beijing","D3":"1","D4":"Finance","D5":"Special Finance","D6":"Adam","D7":"ab","D8":"d82","M1":"7878"},
    {"id":"8","D1":"V2","D2":"Boston","D3":"1","D4":"Finance","D5":"Special Finance","D6":"Adam","D7":"ac","D8":"d81","M1":"3333"},
    {"id":"9","D1":"V2","D2":"Boston","D3":"1","D4":"Finance","D5":"Special Finance","D6":"Adam","D7":"er","D8":"d34","M1":"3333"},
    {"id":"10","D1":"V2","D2":"Boston","D3":"1","D4":"Finance","D5":"Special Finance","D6":"Apple","D7":"df","D8":"d80","M1":"7878"},
    {"id":"11","D1":"V2","D2":"Boston","D3":"1","D4":"Finance","D5":"Special Finance","D6":"Apple","D7":"df","D8":"d55","M1":"7878"}
    // A simple store that loads SaleRecord data from a url
    var myStore = new{
    autoLoad: true,
    proxy : new,
    reader: new{
    }, SaleRecord),

    // Create the PivotGrid itself, referencing the store
    var pivot = new Ext.grid.PivotGrid({
    title: 'PivotGrid example',
    store : myStore,
    aggregator: 'sum',
    measure : 'M1',
    renderTo : Ext.getBody(),
    viewConfig: {
    title: 'Sales Performance'
    leftAxis: [
    width: 60,
    dataIndex: 'D1'
    width: 150,
    dataIndex: 'D2'
    width: 60,
    dataIndex: 'D3'
    width: 60,
    dataIndex: 'D4'
    width: 60,
    dataIndex: 'D5'
    width: 60,
    dataIndex: 'D6'

    topAxis: [
    dataIndex: 'D7'
    dataIndex: 'D8'


  5. #5

    Default Do you need more info to sub,it a bug?

    I am just following up on the issue described by Hank. Do you need more info to submit a bug? or has a bug already been filed? Thanks.


  6. #6
    Sencha User
    Join Date
    Apr 2011


    We are also experiencing the same bug as described by wuxi7227.

    I can confirm that the code sample provided by wuxi7227 correctly reproduces the bug.

    Please advise if you have sufficient information to submit this bug.

  7. #7

    Default Ticket has been filed

    I went ahead and submitted a ticket for this:


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts