谢谢回复!还是上面的数据,增加filter,工作表保护后筛选功能可用,排序无效。
wb = GC.Spread.Sheets.findControl(document.getElementById('ss'));
ws = wb.getActiveSheet();
ds = [{"bmlb":"0002","lbmc":"testfffff4444","pxh":"21","yxbj":"1","xgbj":"1","f_id":"0002"},{"bmlb":"00031","lbmc":"testfffff","pxh":"20","yxbj":"1","xgbj":"","f_id":"00012"}]
ws.setDataSource(ds);
range = new GC.Spread.Sheets.Range(-1, 0, -1, ws.getColumnCount());
rowFilter = new GC.Spread.Sheets.Filter.HideRowFilter(range);
ws.rowFilter(rowFilter);
ws.options.protectionOptions.allowFilter = true;
ws.options.isProtected = true;
取消保护后(ws.options.isProtected = false;)排序功能可用。这是什么原因? |