|
@@ -1,4 +1,4 @@
|
|
|
-/**
|
|
|
+/**
|
|
|
* Created by CSL on 2017-03-23.
|
|
|
*/
|
|
|
var region = '重庆';
|
|
@@ -15,6 +15,10 @@ $(document).ready(function () {
|
|
|
$("#projectFeeFile").click(function () {
|
|
|
loadProjectFeeRates(feeRateFileID);
|
|
|
});
|
|
|
+
|
|
|
+ $("#logout").click(function () {
|
|
|
+ location.href = '/logout';
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
function loadProjectFeeRates(fileID) {
|
|
@@ -75,10 +79,6 @@ function loadLibFeeRates(libID) {
|
|
|
|
|
|
function createSpreadView(canEdit) {
|
|
|
// 创建前先销毁旧树表。
|
|
|
- //$('#divFee').empty(); // 清空不行,浏览器跟踪显示错误数狂飚:TypeError: G is null
|
|
|
- //$('#divFee').remove(); // 删除可以,但是太山寨。
|
|
|
- //$('#content').append($('<div class="grid" id="divFee"></div>'));
|
|
|
- // 以下找到官方的处理方法,比较面向对象
|
|
|
if (spreadView) {
|
|
|
spreadView.destroy();
|
|
|
spreadView = null;
|
|
@@ -173,8 +173,36 @@ function createSpreadView(canEdit) {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ function showObjs(arr){
|
|
|
+ var s = '';
|
|
|
+ for (var i = 0; i < arr.length; i++) {
|
|
|
+ s = s + JSON.stringify(arr[i]) + "\n";
|
|
|
+ }
|
|
|
+ alert(s);
|
|
|
+ }
|
|
|
+
|
|
|
+ function showObjs2(obj) {
|
|
|
+ var str = "";
|
|
|
+ var spr = "";
|
|
|
+ for (var x in obj) {
|
|
|
+ if (obj.hasOwnProperty(x)) {
|
|
|
+ if(str == ''){ spr = '' } else { spr = ', '};
|
|
|
+ str += spr + x + ':' + obj[x];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ }
|
|
|
+
|
|
|
+ function rowClickFun(sender, args) {
|
|
|
+ //var arr = [args.event, args.hitInfo, args.item.dataItem];
|
|
|
+ //showObjs(arr);
|
|
|
+ alert(showObjs2(spreadView.getItem(4).item));
|
|
|
+ }
|
|
|
+
|
|
|
spreadView = new GC.Spread.Views.DataView($('#divFee')[0],
|
|
|
dataSource, columns, new GC.Spread.Views.Plugins.GridLayout(options));
|
|
|
+
|
|
|
+ spreadView["rowClick"].addHandler(rowClickFun);
|
|
|
spreadView.invalidate();
|
|
|
document.querySelector('#divFee').focus();
|
|
|
}
|