Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

ListGrid record move up/down problem

$
0
0
Version: smartgwt-power-5.0-p20150731
On version 4.1, we had ListGrid subclass with move up/down buttons (created by overriding createRecordComponent) to allow users to reorder rows.

Our code was for move up was:
Code:

        private void moveUp(ListGridRecord record) {
                RecordList rs = getRecordList();
                int index = getRecordIndex(record);

                if (index > 0) {
                        rs.removeAt(index);
                        rs.addAt(record, index - 1);
                }
        }

With 5.0-p20150731, this code starts a indefinite 100% cpu use with the calls:
isc_c_Timer__fireTimeout
isc_c_Class_fireCallback
isc_c_Canvas_clearRedrawQueue
isc_c_Canvas_clearDestroyQueue

We managed to work that around at the cost of some flicker effect, with:
Code:

        private void moveUp(final ListGridRecord record) {
                final RecordList rs = getRecordList();
                final int index = getRecordIndex(record);

                if (index > 0) {
                        rs.removeAt(index);
                        Scheduler.get().scheduleDeferred(new Command() {
                                @Override
                                public void execute() {
                                        rs.addAt(record, index - 1);
                                }
                        });
                }
        }

We'd like to use our previous code to avoid the flicker. Is there anything wrong with it that could cause the issue?

Viewing all articles
Browse latest Browse all 4756

Trending Articles