Announcement

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

    ListGrid setEditValue with JSObject

    Hi,

    I see a getEditValueAsJSObj method on ListGrid,
    but no setEditValue(int rowNum, String fieldName, JavaScriptObject value)

    Can you add this method please?

    SmartGWT EE SC_SNAPSHOT-2011-07-26

    #2
    Hi,

    using 3.0p.2012-05-02

    I need to get and set edit value, but don't want to consider type,
    when setting the value back.

    Seems like there is no getEditValueAsJSObj on ListGrid,
    and setEditValue doesn't support to pass Object.
    so I need code like:

    if(editedValue instanceof Integer){
    grid.setEditValue(editedRowColsInformation.getRowNum(), editedRowColsInformation.getColNum(),
    (Integer)editedValue);
    }else if(editedValue instanceof String){
    }else if (editedValue instanceof Boolean){
    grid.setEditValue(editedRowColsInformation.getRowNum(), editedRowColsInformation.getColNum(),
    (Boolean)editedValue);
    }else{
    SC.logWarn("Value to store could not be casted and saved");
    }


    is there a better way ?

    Thanks

    Comment


      #3
      We've added a new setEditValue() method which takes an Object param, which will handle casting Integer / String / Date etc to the appropriate type and updating the edit value with it.
      This will show up in the next nightly build

      Comment


        #4
        - was taking cached version of smartgwt, and not updating to newest smartgwt version on my machine

        Thanks for new API !
        Last edited by damend; 19 Jul 2012, 04:03.

        Comment

        Working...
        X