Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Custom summaryType returning Html for summarized sparkline graphs....
29/08/2014
22:28
Avatar
toadicusrex
Member
Members
Forum Posts: 3
Member Since:
29/08/2014
sp_UserOfflineSmall Offline

So I had this working, then I had to change around the solution and I can't get it back to where I was.

So I have a jqGrid which consists of an numeric array in each cell (huge matrix).  I have grouping and hence summaries of this data.  I built a summaryType custom function that worked great before - if I return a numeric value I see the summary, but if I try to return html I get 0 only in the result.  

If you have any ideas I'd love some help - is there some setting I need to have in place for non-numeric summary values?

Here's my setup:

function sumValueFieldArray(val, name, record) {
            var summedValue = '<span>Empty</span>';
            if (val && val != '') {
                var newArray = new Array();
                var valArray = extractSparklineData(val).split(',');
                var recordArray = record[name].split(',');
                for (var i = 0; i < valArray.length; i++) {
                    newArray[i] = parseInt(valArray[i], 0) + parseInt(recordArray[i], 0);
                }
                summedValue = newArray.join(",");
            }
            else {
                summedValue = record[name];
            }
            summedValue = lookupSparklineHtml(summedValue);
            return summedValue;
        }

function lookupSparklineHtml(cellvalue) {
            if (cellvalue == null) {
                return '<span>0</span>&nbsp;&nbsp;<span class="inlinesparkline">0</span>';
            }
            var sum = sumValueArrayString(cellvalue);
            if (cellHasHighestRankedCases(cellvalue)) {
                return '<span style="color:red;">' + sum + '</span>&nbsp;&nbsp;<span class="inlinesparkline">' + cellvalue + '</span>';
            } else {
                return '<span>' + sum + '</span>&nbsp;&nbsp;<span class="inlinesparkline">' + cellvalue + '</span>';
            }
        }

function extractSparklineData(sparklineHtml) {
            return sparklineHtml.substring(sparklineHtml.indexOf('ine">') + 5, sparklineHtml.lastIndexOf("<"));         }


29/08/2014
22:40
Avatar
toadicusrex
Member
Members
Forum Posts: 3
Member Since:
29/08/2014
sp_UserOfflineSmall Offline

I've been looking at summaryTpl - it seems like that might have something to do with it.  But when I try to add a template "function"... (that kinda seems to defeat the purpose of an html template, I know) ... it throws up saying it's an undefined function.  Go figure.

29/08/2014
22:51
Avatar
toadicusrex
Member
Members
Forum Posts: 3
Member Since:
29/08/2014
sp_UserOfflineSmall Offline

It would be nice if you could just say "use the same formatter" when doing the summary... I'm a bit confused why it isn't.

13/09/2014
13:10
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

 

Any chance to look at your whole code or a link to the problem?

 

Regards

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
38 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information