GXT ModelData Cloning/copy

Clean way:

 public static void cloneModelData(ModelData source, ModelData dest) {
       dest= new BaseModelData(source.getProperties());
    }

Another way if you need to do any modification during looping.

 public static void cloneModelData(ModelData source, ModelData dest) {
 Iterator iterator = source.getPropertyNames().iterator();
 while (iterator.hasNext()) {
 String key = iterator.next();
 dest.set(key, source.get(key));
 }
 }

FroM HERE

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s