Announcement

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

    Hello everybody,

    I am new to smartGWT and evaluating possibility of implementing following scenario in it.

    in a ListGrid attached to a DataSource,

    lets denote Rows (Record) as A, B, C, ... etc respectively
    and Columns (Field) ac 1, 2, 3, .. etc respectively as with a spreadsheet cell numbering scheme,

    if I were to fetch column B (say B1 to B100) and set A1 to an arbitrary value

    how can I automatically calculate following formula like behavior at client side at column A (A2 to A100)

    A2=A1+B1
    A3=A2+B2
    A4=A3+B3

    Hope I make my requirement clear.

    Please help.

    Sahan

    #2
    setCellFormatter is probably your easiest bet.

    Comment


      #3
      Sorry if I didn,t make my self clear. Please refer the attachment.

      Tried the setCellFormatter but the problem is as you can see from the picture attached, Data values must be set / get across Row boundaries.

      A2 = A1 + B1
      A3 = A2 + B2 etc

      Is it possible with the Cell Formatter ?
      Attached Files

      Comment


        #4
        Sure you can still do it. Given you got all the values which aren't calculated, and the calculated cells are just filled with whatever. Then in the cell formatter, you can easily do grid.getRecord(rowNum - 1).getAttributeAsInt("col1") + grid.getRecord(rowNum - 1).getAttributeAsInt("col2")

        Of course that is a raw example, you need to use correct column names and whatever but that is the general idea.

        Comment

        Working...
        X