Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Reg: Problem with the Cube Grid basic example

$
0
0
Hi,

I am trying to run the sample example of Cube grid. But I am getting the below error while running in my local.

Code:

Unable to get value of the property 'data': object is null or undefined
ISC_Analytics.js, line 1108 character 5

I have used below code to run the example:

Smartclient version : Isomorphic SmartClient/SmartGWT Framework (9.1p_2014-06-28/PowerEdition Deployment 2014-06-28)

Browser : IE9


Code:

  <%@ taglib uri="/WEB-INF/iscTaglib.tld" prefix="isomorphic"  %>
<%@ page contentType="text/html; charset=WINDOWS-1256" pageEncoding="WINDOWS-1256" %>
<HTML>
<HEAD>

<STYLE>
        .headerText {font-family:Verdana,Helvetica,sans-serif; font-size:12px; font-weight:bold; color:black;}
</STYLE><TITLE>
        SmartClient Multidimensional DataSource Demo


       

</TITLE></HEAD><BODY>
       
<SCRIPT SRC=../isomorphic/system/modules/ISC_Containers.js></SCRIPT>
<SCRIPT SRC=../isomorphic/system/modules/ISC_Core.js></SCRIPT>
<SCRIPT SRC=../isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
<SCRIPT SRC=../isomorphic/system/modules/ISC_Grids.js></SCRIPT>
<SCRIPT SRC=../isomorphic/system/modules/ISC_DataBinding.js></SCRIPT>
<SCRIPT SRC=../isomorphic/system/modules/ISC_Drawing.js></SCRIPT>
<SCRIPT SRC=../isomorphic/system/modules/ISC_Charts.js></SCRIPT>
<SCRIPT SRC=../isomorphic/system/modules/ISC_Analytics.js></SCRIPT>
<SCRIPT SRC=../isomorphic/skins/TreeFrog/load_skin.js></SCRIPT>


<SCRIPT>

var productRevenue_facets = [

                                {
                                        id:"region",
                                        title:"region",
                                isTree:true,
                                        values:[
                                                {id:"sum", title:"All Regions", collapse:false},
                                                {id:"Western U.S.", parentId:"sum", title:"Western U.S."},
                                                {id:"Midwest U.S.", parentId:"sum", title:"Midwest U.S"},
                                                {id:"Eastern U.S.", parentId:"sum", title:"Eastern U.S."}
                                        ]
                                },

                                  {
                                        id:"quarter",
                                        title:"quarter",
                                        isTree:true,
                                        collapsed:true,
                                        width:150,
                                        values:[
                                                {id:"sum", title:"All Years", collapsed:false},
                                                {id:"2002", parentId:"sum", title:"2002", collapsed:false},
                                                {id:"2003", parentId:"sum", title:"2003", collapsed:false},
                                                {id:"Q1, 2002", parentId:"2002", title:"Q1, 2002"},                                               
                                                {id:"Q1, 2003", parentId:"2003", title:"Q1, 2003", collapsed:false}
                                               
                                        ]
                                },
                               
                                {
                                        id:"product",
                                        title:"product",
                                        isTree:true,
                                        collapsed:true,
                                        width:175,
                                        values:[
                                                {id:"sum", title:"All Products", collapsed:false},
                                                {id:"Pens", parentId:"sum", title:"Pens"},
                                                {id:"Chairs", parentId:"sum", title:"Chairs"},
                                                {id:"Monitors", parentId:"sum", title:"Monitors", collapsed:false}
                                        ]
                                }
                        ];


var productData = [

                          {quarter:"Q1, 2002",  region:"Western U.S.", product:"Pens",  _value:10000},
                          {quarter:"Q1, 2002",  region:"Western U.S.", product:"Chairs",  _value:50000},
                          {quarter:"Q1, 2002",  region:"Western U.S.", product:"Monitors",  _value:120000},

                    {quarter:"Q1, 2002", region:"Midwest U.S.", product:"Pens",  _value:8000},
                          {quarter:"Q1, 2002", region:"Midwest U.S.", product:"Chairs",  _value:22000},
                          {quarter:"Q1, 2002",  region:"Midwest U.S.", product:"Monitors",  _value:20000, _hilite:"under10"},

                          {quarter:"Q1, 2002",  region:"Eastern U.S.", product:"Pens",  _value:2000},
                          {quarter:"Q1, 2002",  region:"Eastern U.S.", product:"Chairs",  _value:2000},
                          {quarter:"Q1, 2002",  region:"Eastern U.S.", product:"Monitors",  _value:5000, _hilite:"under10"},                 
                         
                              {quarter:"Q1, 2003", region:"Western U.S.", product:"Pens",  _value:10000},
                          {quarter:"Q1, 2003", region:"Western U.S.", product:"Chairs",  _value:50000},
                          {quarter:"Q1, 2003", region:"Western U.S.", product:"Monitors",  _value:120000},

                 
                          {quarter:"Q1, 2003", region:"Midwest U.S.", product:"Pens",  _value:8000},
                          {quarter:"Q1, 2003", region:"Midwest U.S.", product:"Chairs",  _value:22000},
                          {quarter:"Q1, 2003", region:"Midwest U.S.", product:"Monitors",  _value:20000, _hilite:"under10"},

                    {quarter:"Q1, 2003", region:"Eastern U.S.", product:"Pens",  _value:22000, _hilite:"over50"},
                          {quarter:"Q1, 2003", region:"Eastern U.S.", product:"Chairs",  _value:40000},
                          {quarter:"Q1, 2003", region:"Eastern U.S.", product:"Monitors",  _value:105000}

                         
                  ];

isc.CubeGrid.create({
    ID: "report",
    data: productData,
    width:"100%",
    height:"100%",
  // hideEmptyFacetValues:true,
   
  // formatCellValue:"isc.Format.toUSDollarString(value)",
        facets:        productRevenue_facets,
    columnFacets:["quarter"],
    rowFacets:["region","product"],
    // hover tips
    canHover:true,
    cellHoverHTML:"if (record != null) return 'cell value: '+record.value+'<br>cell ID: '+record.cellID;",
    hoverProperties:{width:150, height:20},

    enableCharting:            true,
    showFacetValueContextMenus:    true,
    showFacetContextMenus:        true,
    showCellContextMenus:        true,
    valueTitle:"Sales",

    // misc settings for this application
    canCollapseFacets:true,
    canMinimizeFacets:true,
    autoSelectValues:"both",    // both, cols, row, none
    rowHeaderGridMode:true,
    canMoveFacets:true
   
});


</SCRIPT>
</BODY>
</HTML>

Please suggest me what to do to resolve the same.

Thanks in advance.

Viewing all articles
Browse latest Browse all 4756

Trending Articles