Solved

jqGrid not showing yDimension when numeric values

Posted on 2014-10-01
6
521 Views
Last Modified: 2014-10-22
jqGrid fails to render data columns in the below scenario - all I get is the 'Type' column.

Note that the values for year are all numeric - if I change the values to 'Year1', 'Year2' etc, the grid works correctly, but I will be receiving raw numeric values for this field.

        jQuery("#grid").jqGrid('jqPivot',
        mydata,
		// pivot options 
		{
			xDimension: [
                        { dataName: 'Type', width: 170, editable: false, key: true}
			],

			yDimension: [{ dataName: 'Year' }],

			aggregates: [
                       { member: 'Amount', aggregator: 'sum', editable: true, width: 90, align: 'right', formatter: 'currency', formatoptions: { decimalPlaces: 2 } }
                       //{ member: 'Amount', aggregator: 'sum', editable: true, width: 90, edittype: 'custom', editoptions: { custom_element: myelem, custom_value: myvalue }, width: 90, align: 'right', formatter: 'currency', formatoptions: { decimalPlaces: 2 } }
			    
			]
		},
        // grid options
        {
            width: 780,
            cellEdit: true,
            cellsubmit: 'clientArray',
            rowNum: 150
        });


    var mydata = [
          { "Type": "10", "Year": "1", "Amount": "1008.0000" },
          { "Type": "200", "Year": "2", "Amount": "140.0000" },
          { "Type": "300", "Year": "3", "Amount": "130.0000" },
          { "Type": "400", "Year": "4", "Amount": "0000"},
          { "Type": "500", "Year": "5", "Amount": "0000"},
          { "Type": "600", "Year": "6", "Amount": "0000" },
          { "Type": "600", "Year": "7", "Amount": "0000" },
    ];

Open in new window

0
Comment
Question by:sailing_12
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 40358408
look fine for me : http://jsfiddle.net/hoyjrr0t/1/
0
 

Author Comment

by:sailing_12
ID: 40366994
Hmm - I see that. Still not working for me here.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40367061
time to share a link to your page.
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:sailing_12
ID: 40367138
can't - internal app.
0
 

Accepted Solution

by:
sailing_12 earned 0 total points
ID: 40386706
Created a dictionary array to get around this.
0
 

Author Closing Comment

by:sailing_12
ID: 40396415
Unable to reproduce the issue and provide a solution outside internal environment.
0

Featured Post

What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question