Announcement

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

    Getting the cellFormatter from a ListGridField

    SGWT 2.5 (as of 08/31/2011):
    There is a ListGridField.setCellFormatter() in place but no ListGridField.getCellFormatter().
    This is a problem when using a custom SummaryFunction as the values are not/can not be formatted according to the CellFormatter set for that field.
    Is there another means to format values that are determined by a CellFormatter?

    Thanks
    fatzopilot

    #2
    A getCellFormatter would also be helpful for me,
    because I am setting specific formatting in the first step,
    and if no specific cellformatter is there, apply general formatting rules.

    Comment


      #3
      It's not clear what you're asking for - do you want to be able to get a CellFormatter you previously provided, or are you trying to get the value that the ListGrid would have output if you had not provided a CellFormatter?

      Comment


        #4
        Saw that the original poster did not respond and we would be interested in knowing how to get the value that the ListGrid would have output if we had not provided a CellFormatter. Our scenario is that we want a field that will be/shown as a Link type is some rows but shown as normal text in other rows, depending on the data.

        Comment


          #5
          Yeah, sorry, this was what my original question is aiming at, too (Getting back the "native" object).
          Please correct me, but I don't think it is easily possible to do this, since I believe there is no such Java Object existing in reality (but a JS Object) that could be passed back. This is one of the quirks you have to live with when using a wrapper...

          Comment


            #6
            This has nothing to do with being a wrapper, there's just not an API at the moment to retrieve the value without your CellFormatter applied (and it would be a String anyway). We're looking at adding one.

            Comment


              #7
              I fear we are talking about different things here, and I just noticed that the last line in my original post should read: "Is there another means to format values that are determined by a *SummaryFunction*?"
              There was a bug (now fixed) that prevented the summary field to be formatted exactly as the actual values (e.g. with just 2 decimal places).
              So, I was looking for a way to use the object/formatter (i.e. an object that implements the CellFormatter interface) used for formatting the actual field values to format the Summary values as well. But this turned out to be not feasible.
              I ended up formatting the value in a customized AveragingSummaryFunction instead of just setting a SummaryFunctionType.
              Btw. the detail fields still don't respect the field formatter/there is no way to set a specific formatter for detail fields...

              Comment


                #8
                Hi All
                Ed - we have added an API "listGrid.getDefaultFormattedValue(record, rowNum, colNum)" which will return the formatted string value for the cell, as if you had no custom formatter applied.
                This should allow you to implement your use case (having a "link" type field return the normal HTML link in some cases but conditionally do something else).

                Fatzopilot - It sounds like you resolved your first issue with formatting summary fields. We're still not quite clear on what the problem was.
                It sounds like you're looking for a way to apply a cellFormatter to fields generated from the summary editor -- if so, you could presumably use the 'setCellFormatter()' API at the grid level, and conditionally apply the formatting you need based on the cell you're looking at.
                If you think there's a bug there that we should be aware of please let us know. Probably best to show us a simple runnable test case we can look at that clearly demonstrates the issue.

                Also - we're not following what the issue is with detail fields. Not sure if you're referring to dataSource fields marked as "detail:true" [and shown via the "setShowDetailFields(true)" API], or to expansion components.
                Probably best if you show us a test case here too, or refer us to a showcase example that demonstrates the issue.

                Thanks
                Isomorphic Software

                Comment

                Working...
                X