Announcement

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

    ListGrid.exportData() question and observation

    Hi Isomorphic,

    I have a few questions regarding ListGrid.exportData() (12.1p), as I'm in the process of converting some of my ListGrids from exportClientData() to exportData().
    I wondered about how the server knows what fields to export with exportData(), when this information is not in DSRequest-subtab in the Developer Console RPC Tab. I then found the fieldlist in the RPCRequest-subtab. Is this correct? Shouldn't this and possibly other information there be part of the DSRequest-tab? exportFields is even a property of DSRequest.

    Then I wondered how the default field list is built (because for one fields I get the (unwanted) ID and the name in the exported file).
    I can see one field here for me, where the client sends the ID instead of the expected Name-field.
    Code:
    "exportFields":[...
                ....
                "MD_LEADTEMPERATURE_NAME",
                "MD_CAMPAIGN_NAME",
                "MD_LEADTYPE_ID",
                "MD_EARLIEST_START",
                ...
    Here it is MD_LEADTYPE_ID, where I'd expect MD_LEADTYPE_NAME.
    I can't seem to find a difference in the field definition in my clientside ListGridField (they all have name: "ID-version-of-the-fieldname").
    Also in the .ds.xml DataSourceFields the definitions are similar (=ID-field with displayField pointing to the Name-field).

    So from my perspective MD_LEADTYPE_ID and MD_LEADTEMPERATURE_ID have a similar setup, yet for one the ID field is used to export.
    Could you explain how ListGrid.exportData() decides which fieldnames it sends to the server? Then I could perhaps find what the configuration difference here might be.

    Thank you & Best regards
    Blama

    #2
    First of all, please give us an idea of what you want to achieve before diving into low-level mechanics..

    exportData() exports all DataSource fields by default, or you can set exportFields to have a limited export. exportData() cannot export fields that are not part of the DataSource (e.g. only exist in a specific ListGrid) - use exportClientData() for that.

    Comment


      #3
      Hi Isomorphic,

      exportData() called from client side already includes a field list, so that not all DataSource fields are exported, which is great.
      The problem is, that this list is not correct in my case and I'm wondering why this is (framework bug or somehow "differently" configured field).

      What I want to do is to replace my use of exportClientData() export with exportData(), as exportClientData() does not work for the amount of rows I have.
      But of course the export should look as neat as possible (meaning like exportClientData() minus the impossible things like Hilites or custom formatting). This is what I'm trying to archive. Of course I could list the fields myself by traversing the ListGrid and check for what's being shown, but you seem to already do that in some way.

      Best regards
      Blama

      Comment


        #4
        The docs for exportValueFields - which cover what the export system does by default with displayField settings and valueMaps - may clarify what you are seeing.

        https://smartclient.com/smartclient/...ortValueFields

        Comment


          #5
          Hi Isomorphic,

          yes, I saw it and played with it. I also saw the exportFormatting-docs, which show this in more detail.
          Not setting it leads to the best results for me.
          But here I have the problem from #1, where for some fields I get the expected text-only version and for others I get IDs+Text.

          In my opinion I'm in the
          "exportData(), in-record displayField (must be declared in DataSource), exportValueFields not specified"-row, but sometimes the ID field is missing (as if I specified exportValueFields: true).
          The "exportData(), in-record displayField (must be declared in DataSource), exportValueFields=true" looks like what I want, but does not work as expected properly either.

          Right now I'm setting exportFields explicitly on clientside and replace the ID-fields with the name fields (=the displayField from the .ds.xml) manually. This way I can get the wanted result, but of course I would be nicer if it worked correctly out of the box.

          Best regards
          Blama

          Comment


            #6
            Hi Isomorphic,

            sorry, small mistake. I should be in the "...exportValueFields not specified"-row, but this is not true, as the clientside sets exportFields automatically (also also exportFieldTitles and exportHeaderSpans). This is of course nice, as it results in an export one would expect. But as I wrote in #1, it's not clear to me how this field list is built.

            As the exportFields as set automagically, this is not a server side exportData() issue, more a question/problem on how this fieldlist is built on the client side.

            Best regards
            Blama

            Comment

            Working...
            X