Seajs + easyui [turn]

Source: Internet
Author: User

* *content seajs+Easyui Use*//** * First to see how jquery and jquery plugins are used in Seajs*/1. Jquery.jsdefine (function(Require,exports,module)) {    //Original Jquery.js CodeModule.exports = $.noconflict (true);}2The . Jquery.combobox.js dependency relationship is as follows: Jquery.combobox.js relies on jquery.combo.jsjquery.combo.js jquery.panel.js, Jquery.vali Datebox.jsjquery.validatebox.js rely on jquery.tooltip.js that how to encapsulate jquery.combobox.js and dependent plug-ins? 1) Jquery.combobox.jsdefine (function(require,exports,module) {return function($) {require ("Plugins/jquery.combo"); //plug-in code    }});2) Jquery.combo.jsdefine (function(Require, exports, module) {return function($) {require ("Plugins/jquery.validatebox")($); Require ("Plugins/jquery.panel")($); //Original Jquery.combo.js Code    }});3) Jquery.validatebox.jsdefine (function(Require, exports, module) {return function($) {require ("Plugins/jquery.tooltip")($); //Original Jquery.validatebox.js Code    }});4) Jquery.panel.js, Jquery.tooltip.jsdefine (function(Require, exports, module) {return function($) {        //Original Jquery.validatebox.js/jquery.panel.js Code(function($){            ......        })        (JQuery); //Notice that you want to change jquery to $, or change the argument to jquery in Init.js    }});/** * Related examples*/a) index.html<!doctype html>Seajs.use ("./init",function(init) {init.initpage ()});</script></body>b) Init.jsdefine (function(require,exports,module) {//Load Dependent modules    var$ = require ("jquery"); Require ("./plugins/jquery.combobox")($); //private properties and methods    varName = "Benjamin_private"; varSetName =function(name) {Console.log ("My name is" +name); }    //public properties and methodsModule.exports ={name:"Benjamin_public"Initpage:function(){            $("#sel_refresh"). ComboBox ({width:150, OnSelect:function(REC) {Console.log (rec);        }            }); }, SetName:function(name) {Console.log ("My name is" +name); }}); c) Jquery.combobox.js and dependent plug-in code see above/** * Problem*/

A) When using Seajs+easyui, the jquery.parse.js of the Easyui framework is basically useful for each control, so it is recommended that each control adds dependency when it is added, and when changing the file, be aware that both closures in the file have to change the arguments.
b) Avoid cache settings
You can add a timestamp after the link, or you can configure it directly
Seajs.config ({
Debug:2;
});

c) Each of the control style files in this instance is not set to be loaded by the module, you can set
d) Follow-up summary of other issues added ...

Seajs + easyui [turn]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.