直接改变spread.sheets内容的顺序即可
- var oldIndex = 3, newIndex = 1
- if(oldIndex > newIndex){
- var sheets = spread.sheets.splice(oldIndex, 1);
- spread.sheets.splice(newIndex, 0 ,sheets[0])
- }
- else{
- spread.sheets[newIndex] = spread.sheets.splice(oldIndex, 1, spread.sheets[newIndex])[0]
- }
- spread.refresh()
复制代码 |