Announcement

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

    Refresh ListGrid row

    How can I force the record data in a ListGrid to reload from the remote DataSource?

    #2
    Just fetch that individual record by primaryKey and overwrite all the properties on the record in the ResultSet. In pseudocode:

    Code:
       myDataSource.fetchData({pkField: record.pkField}, function (dsResponse, data) {
           isc.addProperties(record, data[0]);
           myListGrid.refreshRow(rowNum);
       })

    Comment


      #3
      smartGWT 2.2 LGPL

      Is this code the equivalent of your pseudo-code to perform a one-row refresh from datasource?

      Code:
      public void onSuccess(Void result) //onSuccess from a GWT-RPC treatment on the database
      {
          for(ListGridRecord rec : listgrid.getSelection())
          {
              final int rowNum = listgrid.getRecordIndex(rec);
              listgrid.fetchData(new Criteria("object_id", rec.getAttribute("object_id")), new DSCallback()
              {
                  public void execute(DSResponse response, Object rawData, DSRequest request)
                  {
                      listgrid.refreshRow(rowNum);
                  }
              });
          }
      }

      Comment

      Working...
      X