Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    exportFields not working for xml export

    "SNAPSHOT_v12.1d_2019-07-22/AllModules Development Only"

    Chrome on OSX

    Hello, please try this testcase (it's the 'FSexport' sample, with the addition of the exportFields property):

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:500, height:250, top:70, alternateRecordStyles:true,
        dataSource: worldDSExport,
        autoFetchData: true,
        fields:[
            {name:"countryName", title:"Country"},
            {name:"capital", title:"Capital"},
            {name:"continent", title:"Continent"},
            {name:"independence", title:"Nationhood", width:100},
            {name:"population", title:"Population"}
        ],
        showFilterEditor: true
    });
    
    isc.DynamicForm.create({
        ID: "exportForm",
        width:300,
        fields: [
            { name: "exportType", title: "Export Type", type:"select", width:"*",
                defaultToFirstOption: true,
                valueMap: {
                    "csv" : "CSV" ,
                    "xml" : "XML",
                    "json" : "JSON",
                    "xls" : "XLS (Excel97)",
                    "ooxml" : "OOXML (Excel2007)"
                }
            },
            { name: "showInWindow", title: "Show in Window", type: "boolean", align:"left" }
        ]
    });
    
    isc.Button.create({
       ID: "exportButton",
       title: "Export",
       left: 320,
       click: function () {
           var exportAs = exportForm.getField("exportType").getValue();
           var showInWindow = exportForm.getField("showInWindow").getValue();
           if (exportAs == "json") {
               // JSON exports are server-side only, so use the OperationBinding on the DataSource
               countryList.exportData({ operationId: "customJSONExport",
                   exportDisplay: showInWindow ? "window" : "download"});
           } else {
               // exportAs is not JSON, so we can set that with requestProperties
               countryList.exportData({ exportAs: exportAs,
                   exportFields:["continent", "area"],
                   exportDisplay: showInWindow ? "window" : "download"
               });
           }
       }
    });
    If you export in xml format, the xml file contains all datasource's fields.
    Last edited by claudiobosticco; 22 Jul 2019, 23:52.

    #2
    This is fixed and will be available for download in nightly builds since Aug 2 (tomorrow).

    Comment


      #3
      SmartClient Version: SNAPSHOT_v12.1d_2019-08-08/AllModules Development Only (built 2019-08-08)

      I can confirm it's fixed, thank you very much

      Comment

      Working...
      X