Views¶
addView¶
添加视图
dtable.addView(tableName, viewName);
其中
- tableName: 子表名字
- viewName: 添加视图的名字
例子
dtable.addView('tableName', 'viewName');
deleteView¶
删除视图
dtable.deleteView(tableName, viewName);
其中
- tableName: 子表名字
- viewName: 删除视图的名字
例子
dtable.deleteView('TableName', ViewName);
renameView¶
修改视图名字
dtable.renameView(tableName, oldViewName, newViewName);
其中
- tableName: 子表的名字
- oldViewName: 视图的旧名字
- newViewName: 视图的新名字
例子
dtable.renameView('tableName', 'oldViewName', 'newViewName');
getViews¶
获取 table 中的非私有视图
dtable.getViews(table);
其中
- table: 子表对象
例子
const tableId = '0000';
const table = dtable.getTableById(tableId);
const views = dtable.getViews(table);
getNonArchiveViews¶
获取 table 中的非私有且非归档视图
dtable.getNonArchiveViews(table);
其中
- table: 子表对象
例子
const tableId = '0000';
const table = dtable.getTableById(tableId);
const views = dtable.getNonArchiveViews(table);
getActiveView¶
获取当前 base 正在访问的视图
dtable.getActiveView();
例子
const view = dtable.getActiveView();
getViewByName¶
通过 name 获取视图内容
dtable.getViewByName(table, viewName);
其中
- table: 子表对象
- viewName: 获取视图的名字
例子
const tableId = '0000';
const table = dtable.getTableById(tableId);
const viewName = 'viewName';
const view = dtable.getViewByName(table, viewName);
getViewById¶
通过 id 获取视图内容
dtable.getViewById(table, viewId);
其中
- table: 子表对象
- viewId: 获取视图的id
例子
const tableId = '0000';
const table = dtable.getTableById(tableId);
const viewId = '0000';
const view = dtable.getViewById(table, viewId);
isDefaultView¶
判断是否为默认视图(不包含分组, 过滤, 排序等条件)
dtable.isDefaultView(view, columns);
其中
- view: 视图对象
- columns: 子表中所有的列内容
例子
const tableId = '0000';
const table = dtable.getTableById(tableId);
const viewId = '0000';
const view = dtable.getViewById(table, viewId);
const columns = dtable.getColumns(table);
const isDefaultView = dtable.isDefaultView(view, columns);
isGroupView¶
判断是否为包含分组的视图(包含分组条件)
dtable.isGroupView(view, columns);
其中
- view: 视图对象
- columns: 子表中所有的列内容
例子
const tableId = '0000';
const table = dtable.getTableById(tableId);
const viewId = '0000';
const view = dtable.getViewById(table, viewId);
const columns = dtable.getColumns(table);
const isGroupView = dtable.isGroupView(view, columns);
isFilterView¶
判断是否为过滤视图(包含过滤条件)
dtable.isFilterView(view, columns);
其中
- view: 视图对象
- columns: 子表中所有的列内容
例子
const tableId = '0000';
const table = dtable.getTableById(tableId);
const viewId = '0000';
const view = dtable.getViewById(table, viewId);
const columns = dtable.getColumns(table);
const isFilterView = dtable.isFilterView(view, columns);