本帖最后由 Simon.hu 于 2018-3-14 09:31 编辑
这个暂时不好做,您可以参考这个工程中的代码,自动行高,来让别人可以完全看到文字的:
- // JavaScript source code
- // JavaScript source co
- var listivewName = "表格1";
- function getSheet() {
- return $("#" + listivewName).children().wijspread("spread").getActiveSheet();
- }
- function getListview() {
- return Forguncy.Page.getListView(listivewName);
- }
- var listview = getListview();
- var sheet = getSheet();
- autoFitRows(0, listview.getRowCount());
- //var setSourceFun = GcSpread.Sheets.Sheet.prototype.setDataSource;
- //GcSpread.Sheets.Sheet.prototype.setDataSource = function (source, reset) {
- // setSourceFun.apply(this, arguments);
- // autoFitRows(0, listview.getRowCount());
- //}
- listview.bind("reloaded", null, function (e) {
- autoFitRows(0, listview.getRowCount());
- });
- sheet.bind(GcSpread.Sheets.Events.RangeChanged, function (sender, args) {
- autoFitRows(args.row, args.rowCount);
- });
- sheet.bind(GcSpread.Sheets.Events.EditEnded, function (sender, args) {
- autoFitRows(args.row, 1)
- });
- function autoFitRows(row, rowCount) {
- Forguncy.DelayRefresh.Push(this, function () {
- var sheet = getSheet();
- sheet.isPaintSuspended(true);
- for (var r = row; r < row + rowCount; r++) {
- sheet.autoFitRow(r);
- }
- sheet.isPaintSuspended(false);
- }, "_autoFitRows");
- }
复制代码 |