var spread = GcSpread.Sheets.findControl(document.getElementById('bydy'));
var sheet = spread.getActiveSheet();
sheet.sortRange(0, 0, -1, -1, true, [
{index:1, ascending:true}
]);
这样试了一下,的确出现了排序效果,按照索引为1的列排序了
但是表头什么的也都乱套了。我只想让按照数据区排序,所以改成了
var spread = GcSpread.Sheets.findControl(document.getElementById('bydy'));
var sheet = spread.getActiveSheet();
sheet.sortRange(7, 0, -1, -1, true, [
{index:1, ascending:true}
]);
把第一个参数改成了7,也就是数据区开始的第一行。可是排序就不生效,试了一下,row参数只有为0的时候才生效,请问为什么会这样,怎么解决
|