Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Not drop entire json not-last null valued cell when it have properties / formatted string #38

Copy link
Copy link
@GoogleCodeExporter

Description

@GoogleCodeExporter
Issue body actions

What steps will reproduce the problem?
1. Create DataTable object with some not-last null valued cell and add 
formatted String and/or custom property
2. Get the DataTable json.

JsonRenderer implementation: The final json avoid null valued cells when the 
cell isn't last cell of the row even though includeFormatting parameter is true 
valued. The response of the JsonRenderer.renderDataTable for a four-cell row 
with null value at second and third row (but with property and/or formatted 
string) looks like: {v:X,p:{property=value}}},,,{v:Y,p:{property=value}. 

Version: All versions /all platforms (showed at 1.0.2 version but I've seen 
that 1.1.1 has the same behavior)

I understand that this behavior reduces response size but sometimes properties 
and/or formatted values can have visualization purposes (like style with a 
Table visualization) or maybe null values can be useful in some context. I 
think that this option must be optional (to avoid null valued cells or not; 
even last).

I've tried to remove the last condition (not the body condition) in the 
JsonRenderer.appendCellJson and this works for me. 

This change looks like:
[...]
//    if ((isLastColumn) || (!isJsonNull)) { - 'cause i want all info
      sb.append("{");
      // Value
      sb.append("v:").append(valueJson);
      // Formatted value
      if ((includeFormatting) && (!escapedFormattedString.equals(""))) {
        sb.append(",f:'").append(escapedFormattedString).append("'");
      }
      String customPropertiesString = getPropertiesMapString(cell.getCustomProperties());
      if (customPropertiesString != null) {
        sb.append(",p:").append(customPropertiesString);
      }
      sb.append("}");
//    }
} // appendCellJson ends here


Original issue reported on code.google.com by gleon...@gmail.com on 25 Jun 2012 at 9:53

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.