Easyui Study Summary (iv)--parser source analysis
The parser module is the first loaded module of Easyloader, and its main function is to scan the class tag at the beginning of Easyui on the page and initialize it as a Easyui control.
1/** 2 * Parser module is mainly to parse the page Easyui control 3 */4 $.parser = {5//whether automatic resolution 6 Auto:true, 7 8 The control can be parsed 9 plugins:[' LinkButton ', ' menu ', ' Menubutton ', ' SplitButton ', ' layout ', ' Tree ', ' Window ', ' dialog ', ' DataGrid ', One ' ComboBox ', ' Combotree ', ' numberbox ', ' Validatebox ', ' Cal ' Endar ', ' datebox ', ' Panel ', ' tabs ', ' accordion ' 13],14 15//Analytic function parse:function (context) {17 if ($.parser.auto) {(var i=0; i<$.parser.plugins.length; i++) {(functi On () {20//control name var name = $.parser.plugins[i];22 Find the JQ object with Class easyui-control name, for example, easyui-layout23 var r = $ ('. easyui-' + name, context); 24 25 if (r.length) {26//If there is this object, then determine if it has an initialization function, if (r [Name]) {28 If there is a direct call to R[name] (), and the Else if (window . easyloader) {31//If the module's JS file is not loaded in Easyloader, then call the Easyl Oader.load (name, function () {r[name] (); 34}) 35 }36}37}); 38}39}40 }41};42 43//Call the Parse method, actually the Easyloader has already been called, I estimate this is to give not easyloader load when used by the $ (function () {$.parser . Parse (); (););) (jQuery);
Easyui Study Summary (iv)--parser source analysis