Solved

jqGrid not showing yDimension when numeric values

Posted on 2014-10-01
6
489 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 

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

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Handling case and special names in javascript 3 51
make control visible based off other control value 7 45
JQuery on multiple lines 3 48
Jquery Calculation 3 42
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

739 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