通过在每次给collectionView插入行以后,先refresh然后再继续插入即可解决问题
- document.getElementById('paste').addEventListener('click', function() {
- var rowIndex = theGrid.selection.row + 1;
-
- for(var index = 0; index < copiedArr.length; index++) {
- theGrid.collectionView.sourceCollection.splice(rowIndex, 0, copiedArr[index]);
- theGrid.collectionView.refresh();
- rowIndex++
- }
- })
复制代码 |