|
@@ -14,6 +14,7 @@ var rationLibObj = {
|
|
|
checkSpread: function () {
|
|
|
if (!this.rationChapterSpread) {
|
|
|
this.rationChapterSpread = SheetDataHelper.createNewSpread($('#stdRationChapter')[0]);
|
|
|
+ this.rationChapterSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onChapterSpreadCellDoubleClick);
|
|
|
}
|
|
|
if (!this.sectionRationsSpread) {
|
|
|
this.sectionRationsSpread = SheetDataHelper.createNewSpread($('#stdSectionRations')[0]);
|
|
@@ -46,6 +47,7 @@ var rationLibObj = {
|
|
|
var that = this;
|
|
|
var showRationChapterTree = function (datas) {
|
|
|
var rationChapterTree = idTree.createNew({id: 'ID', pid: 'ParentID', nid: 'NextSiblingID', rootId: -1, autoUpdate: false});
|
|
|
+ that.tree = rationChapterTree;
|
|
|
var rationChapterTreeController = TREE_SHEET_CONTROLLER.createNew(rationChapterTree, that.rationChapterSpread.getActiveSheet(), that.rationChapterTreeSetting);
|
|
|
rationChapterTree.loadDatas(datas);
|
|
|
rationChapterTreeController.showTreeData();
|
|
@@ -67,6 +69,23 @@ var rationLibObj = {
|
|
|
showRationChapterTree([]);
|
|
|
});
|
|
|
},
|
|
|
+ //双击隐藏显示
|
|
|
+ onChapterSpreadCellDoubleClick: function (sender, args) {
|
|
|
+ let me = rationLibObj;
|
|
|
+ let node = me.tree.items[args.row];
|
|
|
+ if (!node || node.children.length === 0)
|
|
|
+ return;
|
|
|
+ node.setExpanded(!node.expanded);
|
|
|
+ TREE_SHEET_HELPER.massOperationSheet(args.sheet, function () {
|
|
|
+ let iCount = node.posterityCount(), i, child;
|
|
|
+ for (i = 0; i < iCount; i++) {
|
|
|
+ child = me.tree.items[args.row + i + 1];
|
|
|
+ args.sheet.setRowVisible(args.row + i + 1, child.visible, args.sheetArea);
|
|
|
+ }
|
|
|
+ args.sheet.invalidateLayout();
|
|
|
+ });
|
|
|
+ args.sheet.repaint();
|
|
|
+ },
|
|
|
setTagForHint: function (datas) {
|
|
|
let sheet = this.sectionRationsSpread.getActiveSheet();
|
|
|
sheet.suspendPaint();
|