Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

export not returning titles but field name

$
0
0
SmartClient Version: v8.3p_2014-01-29/Pro Deployment (built 2014-01-29)

When executing an exportData on a list grid, titles are returned correctly for fields. But if I change to use exportClientData and pass in the fields, plus I pass in the exportFields and exportFieldTitles on the request, it does not use the field titles, it returns the field names.

Here is the code I am using to generate the request:
Code:

  exportMyListData : function(aInExportAs_s, aInShowInWindow_b)
    {
        var lExportFieldTitles = {}, i, lField, lVisibleFields = [], lRequestProperties = {};

        if (this.anySelected()) {
            for (i = 0; i < this.fields.length; i++) {
                lField = this.fields.get(i);
                if (this.canExportField(lField)) {
                    lVisibleFields.add(lField.name);
                    lExportFieldTitles[lField.name] = lField.title;
                }
            }

            if (lVisibleFields && lVisibleFields.length > 0) {
                lRequestProperties.exportFields = lVisibleFields;
                lRequestProperties.exportFieldTitles = lExportFieldTitles;
            }

            lRequestProperties.exportAs = aInExportAs_s;
            lRequestProperties.exportDisplay = aInShowInWindow_b ? "window"
                    : "download";
            isc.DataSource.exportClientData(this
                    .getSelectedRecords(),
                    lRequestProperties);
        } else {
            // We go to the server to grab all the
            // alarms if nothing is selected
            this.exportData({
                exportAs : aInExportAs_s,
                exportDisplay : aInShowInWindow_b ? "window"
                        : "download"
            });
        }
    }


Viewing all articles
Browse latest Browse all 4756

Trending Articles