Solved

jqGrid not showing yDimension when numeric values

Posted on 2014-10-01
6
452 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
  • 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

825 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