Announcement

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

    export displayField when valueIcons are defined

    SmartClient Version: v11.0p_2016-04-22/EVAL Development Only (expires 2016.06.21_11.05.07) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)

    Chrome on OSX

    Hello, please modify the #FSexport sample like this:
    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:"member_g8", title:"member_g8", valueMap:{true:"yes", false:"no"}, type:"text",
                imageURLPrefix: "flags/16/", imageURLSuffix: ".png",
                showValueIconOnly: false, valueIcons: {true: "IT", false: "US"}
            }
        ],
        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.exportClientData({ exportAs: exportAs,
                   exportDisplay: showInWindow ? "window" : "download"
               });
           }
       }
    });
    then, if you export in xls format, you'll see 'true' and 'false' for the member_g8 field.
    Is it possible to display 'yes' and 'no', like when you don't have valueIcons for the field?

    #2
    We've committed a fix for this issue to SC 10.1p and newer. It will be in the nightly builds dated 2016-04-26 and beyond.

    Comment


      #3
      SmartClient Version: v11.0p_2016-04-26/EVAL Deployment (expires 2016.06.25_09.26.45) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)
      and
      SmartClient Version: v10.1p_2016-04-26/Enterprise Deployment (built 2016-04-26)

      verified, thank you very much.

      Comment


        #4
        One additional note: you should keep field member_g8 as a "boolean" field as it's declared in the DataSource, rather than to try to set the type to "text". When a valueMap is declared as an object, the object keys should have the type of the field - so in this case the field needs to be "boolean". The mapped values will be string, but that doesn't change the field type.

        Comment


          #5
          Thanks for the note!

          Comment

          Working...
          X