/** * Standard Ration Lib * Created by Mai on 2017/5/16. */ /*var rationChapterSpread, sectionRationsSpread;*/ var rationLibObj = { rationChapterSpread: null, sectionRationsSpread: null, rationChapterTreeController: null, checkSpread: function () { if (!this.rationChapterSpread) { this.rationChapterSpread = SheetDataHelper.createNewSpread($('#stdRationChapter')[0]); } if (!this.sectionRationsSpread) { this.sectionRationsSpread = SheetDataHelper.createNewSpread($('#stdSectionRations')[0]); this.sectionRationsSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, function (sender, args) { var select = $('#stdRationLibSelect'), rationCode = args.sheet.getText(args.row, 0); if (rationCode !== '') { CommonAjax.postRationLib('/rationRepository/api/getRationItem', {user_id: userID, rationLibId: select.val(), code: rationCode}, function (data) { ProjectController.addRation(project, controller, data); }); } }); } }, loadStdRationLibs: function () { CommonAjax.postRationLib('/rationRepository/api/getRationDisplayNames', {user_id: userID}, function (datas) { var select = $('#stdRationLibSelect'); select.empty(); datas.forEach(function (data) { select.append($('