Here's what I want to do. I have a big xml file (there are a lot of daily records... let's say for every 3 hours there are some production records (pieces, scrap and so on). Now... I parse this XML in jQuery and I want to put the data in a jqGrid then show it as a chart with highcharts. The problem is that I don't want to show every record... just the daily results or weekly or monthly so what I need is to sum up all those 3 hour reports by date or by week or by month. I know how to do it... but since there are a lot of records looping through the xml multiple times is not the best idea. So... is there any jquery function or something that will help me do this task more efficient? Or easier? Thanks! If you didn't understand what I want please ask and I'll add more details.
Asked
Active
Viewed 204 times
0
-
why dont you you process the xml server side and send a simplified response to the client – Rafay Mar 11 '12 at 12:54
-
I don't have access to a server... this thing it's to improve my job at work and I can run it only locally in Internet Explorer :(...if I had access to a server I would have used an SQL database and not mess around with xml... – Andrei Ion Mar 11 '12 at 12:57
1 Answers
1
You can try use client side grouping with groupSummary
. See the demo from the answer as an example.
I am not sure that it's exactly what you need, but I hope that you can change the solution so that it's corresponds your requirements.
-
It seems like what I want to do... let me try it and if it works I'll choose your answer...it looks great! Thanks! – Andrei Ion Mar 11 '12 at 13:16
-
it's great but there is another thing... could it support intervals? Let's say I want to see the data from week 1 to week 5 grouped by week... ? – Andrei Ion Mar 11 '12 at 13:19
-
@AndreiIon: I agree. I wrote you that what I suggested is not exactly what you need. It just a step in the direction what you need. I think that it would be better first prepare an example of data and then on the example of the demo data to discuss possible ways to solve your problem. – Oleg Mar 11 '12 at 16:23
-
Thanks for the solution... it works for what I need it. There's another thing I would like to ask you... maybe you know... How can I bind this jqGrid with highcharts? – Andrei Ion Mar 11 '12 at 19:45
-
@AndreiIon: You are welcome! There are many Charts (like from [Google](http://code.google.com/apis/chart/), [Yahoo](http://yuilibrary.com/yui/docs/charts/), [Microsoft](http://archive.msdn.microsoft.com/mschart) and so on) so it's difficult to recommend you someone. All depends on the requirements which you have. In any way you need to get the data from the grid. You can use `$("#grid").jqGrid('getGridParam','data')` if you use `loadonce: true` or `$("#grid").jqGrid('getRowData')` if you have no local data. – Oleg Mar 11 '12 at 19:58