thinkphp學習日誌 2019.10.5

1、BootstrapTable參數、屬性、事件列表

https://blog.csdn.net/qq_38836082/article/details/81450164

2、javascript中(function(){})($)與$(function)的區別:https://blog.csdn.net/wenco1/article/details/82852445

3、js中function(e)的e是什麼意思:e指的是事件:在firefox中,只能在事件現場使用window.event,所以只有把event傳給函數使用,事件對象中的屬性參考:https://www.w3school.com.cn/jsref/dom_obj_event.asp

4、js中匿名函數的N種寫法:https://blog.csdn.net/shichen2010/article/details/83033786

5、JS之匿名函數、閉包、this:

https://www.jianshu.com/p/2089f375e021   

https://www.cnblogs.com/pssp/p/5216085.html

6、JavaScript的函數聲明與函數表達式的區別

function max(){}表示函數聲明,可以放在代碼的任何位置,也可以在任何地方成功調用;

var max  = function(){};表示函數表達式,即將一個匿名函數賦值給一個變量,實現通過變量來調用這個匿名函數,但它需要在聲明過後才能進行調用,如果調用在聲明之前就會報如上紅色字體的錯誤。而這在函數聲明中不會出現這樣的錯誤。

https://www.cnblogs.com/xbj-2016/p/5903611.html

https://www.cnblogs.com/nangezi/p/9105778.html

7、

table.on('load-error.bs.table', function (status, res, e) {
                    if (e.status === 0) {
                        return;
                    }
                    Toastr.error(__('Unknown data format')+'125');
                });

其中load-error.bs.table  爲 JQuery事件,status, res爲參數,當遠程數據被加載出錯後觸發

參考:https://blog.csdn.net/pengjunlee/article/details/80659747

其中參數中的e是指?

可以通過以下方法打印這個e對象:JS打印對象的方法&將Object轉換爲String的函數

通過這個打印json數據:alert(JSON.stringify(json))   

 

8、在thinkphp5及bootstrap-table的調試中,發現ajax請求之後,不太好調試thinkphp5中的程序。如下:

if ($this->request->isAjax()) {
    /*
        代碼塊
    */
    return json($result);
}
return $this->view->fetch();

以上代碼塊中的代碼無法打印變量頁不好調試,經過兩天的問題破解,查找手冊。找到以下方法,方法1與方法2都可以打印數據:

function ($, undefined, Moment) {
    var Table = {
        defaults: {
            responseHandler:function(res){
                //writeObj(res);  方法1
                //alert(JSON.stringify(res));  方法2
                return res;
            },
        }

    };
    
    //qi:輸出對象函數
    function writeObj(obj) {
        var description = "";
        for (var i in obj) {
            var property = obj[i];
            description += i + " = " + property + "\n";
        }
        alert(description);
    }

    return Table;

}

9、頁面js配置

var require = {
	config: {
		"site": {
			"name": "FastAdmin",
			"cdnurl": "",
			"version": "1.0.1",
			"timezone": "Asia\/Shanghai",
			"languages": {
				"backend": "zh-cn",
				"frontend": "zh-cn"
			}
		},
		"upload": {
			"cdnurl": "",
			"uploadurl": "ajax\/upload",
			"bucket": "local",
			"maxsize": "10mb",
			"mimetype": "jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx",
			"multipart": [],
			"multiple": false
		},
		"modulename": "admin",
		"controllername": "index",
		"actionname": "index",
		"jsname": "backend\/index",
		"moduleurl": "\/drUeAKkX5T.php",
		"language": "zh-cn",
		"fastadmin": {
			"usercenter": true,
			"login_captcha": true,
			"login_failure_retry": true,
			"login_unique": false,
			"login_background": "\/assets\/img\/loginbg.jpg",
			"multiplenav": false,
			"checkupdate": false,
			"version": "1.0.0.20190930_beta",
			"api_url": "https:\/\/api.fastadmin2.net"
		},
		"referer": "\/drUeAKkX5T.php\/cms\/archives",
		"__PUBLIC__": "\/",
		"__ROOT__": "\/",
		"__CDN__": ""
	}
};

10、相關資料

1分鐘帶你入門RequireJs並瞭解FastAdmin中JS是如何調用的  https://ask.fastadmin.net/article/6505.html

require.js學習資源合集,從入門到深入FastAdmin中RequireJS的使用  https://ask.fastadmin.net/article/9016.html

一張圖解析FastAdmin中的表格列表的功能   https://ask.fastadmin.net/article/323.html

分享 bootstraptable 全方法 表格方法 js方法 https://ask.fastadmin.net/article/7323.html

分享 bootstraptable 全事件 觸發事件 表格事件 https://ask.fastadmin.net/article/7322.html

查詢bootstraptable資料:https://ask.fastadmin.net/search.html?q=%09bootstrapTable

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章