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 Easyui control in the page3 */4$.parser = {5 //whether to resolve automatically6Autotrue,7 8 //controls that can be parsed9plugins:[' LinkButton ', ' menu ', ' Menubutton ', ' SplitButton ', ' layout ',Ten' Tree ', ' Window ', ' dialog ', ' DataGrid ', One' ComboBox ', ' Combotree ', ' numberbox ', ' Validatebox ', A' Calendar ', ' Datebox ', ' Panel ', ' tabs ', ' accordion ' - ], - the //Analytic Functions -Parsefunction(context) { - if($.parser.auto) { - for(vari=0; i<$.parser.plugins.length; i++){ +(function(){ - //Control Name + varName =$.parser.plugins[i]; A //find the JQ object with Class easyui-control name, for example, Easyui-layout at varr = $ ('. easyui-' +name, context); - - if(r.length) { - //If you have this object, then you have to determine if it has an initialization function - if(R[name]) { - //If there is a direct call in R[name] (); -}Else if(window.easyloader) { to //if the module's JS file is not loaded in with Easyloader, then call +Easyloader.load (Name,function(){ - R[name] (); the }) * } $ }Panax Notoginseng })(); - } the } + } A }; the + //calling the parse method, which is actually called in Easyloader, I guess this is given to not easyloader when it is loaded. -$(function(){ $ $.parser.parse (); $ }); -}) (JQuery);
Easyui Study Summary (iv)--parser source analysis