Solved

jqGrid not showing yDimension when numeric values

Posted on 2014-10-01
6
413 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now