Easyui DataGrid Request URL two times problem

Source: Internet
Author: User

Easyui DataGrid 1.4 Requests Two URL issues when total is 0 o'clock

Framework issue: Need to patch patches after Easyui files

/*** the Patch for jQuery Easyui 1.4*/(function ($) {var plugin = $.fn._size;$.fn._size = function (options, parent) {if (type of options! = ' string ') {return This.each (function () {parent = parent | | $ (this). parent (); if (parent.length) {Plugin.call ( $ (this), options, parent);}); else if (options = = ' Unfit ') {return This.each (function () {var p = $ (this). parent (); if (p.length) {Plugin.call ($ (), options, parent);});} else {return Plugin.call (this, options, parent);}};}) (jQuery);(function ($) {$.map ([' Validatebox ', ' textbox ', ' Filebox ', ' searchbox ', ' Combo ', ' ComboBox ', ' Combogrid ', ' Combotree ', ' datebox ', ' datetimebox ', ' numberbox ', ' spinner ', ' Numberspinner ', ' timespinner ', ' Datetimespinner ', function (plugin) {if ($.fn[plugin]) {if ($.fn[plugin].defaults.events) {$.fn[plugin].defaults.events.click = function (e) {if (!$ (E.data.target). Is (': Focus ')) {$ (e.data.target). Trigger (' Focus ');}};}}); $.fn.combogrid.defaults.height = 22; $ (function () {$ (document). Bind (' Mousewheel.combo ', function (e) {$ (e.target). Trigger (' MoU(Sedown.combo ');});})             (jQuery);(function ($) {$.extend ($.fn.form.methods, {clear:function (JQ) {return Jq.each (function () {             var target = this;  $ (' Input,select,textarea ', target). Each (function () {var t = this.type, tag = This.tagName.toLowerCase (); if (t = = ' Text ' | | t = = ' Hidden ' | | t = = ' Password ' | | Tag = = ' textarea ') {this.value = ';} else if (t = = ' file ') {var file = $ (this); if (!file.hasclass (' Textbox-value ') {var new File = File.clone (). Val ("); Newfile.insertafter (file), if (File.data (' Validatebox ')) {File.validatebox (' destroy '); Newfile.validatebox ();} else {file.remove ();}}} else if (t = = ' checkbox ' | | t = = ' Radio ') {this.checked = false;} else if (tag = = ' select ') {this.selectedindex =-1;}});             var t = $ (target);             var plugins = [' textbox ', ' Combo ', ' ComboBox ', ' Combotree ', ' combogrid ', ' Slider '];                 for (var i=0; i<plugins.length; i++) {var plugin = plugins[i]; var r = T.find ('. ')           +plugin+ '-f ');      if (r.length && R[plugin]) {R[plugin] (' clear '); }} $ (target). form (' Validate ');});}) (jQuery);(function ($) {function setSize (target, param) {var opts = $.data (target, ' LinkButton '). Options;if (param) {$.E Xtend (opts, param);} if (opts.width | | opts.height | | opts.fit) {var btn = $ (target); var parent = Btn.parent (); var isVisible = btn.is (': Visible ') if (!isvisible) {var spacer = $ (' <div style= "Display:none" ></div> "). InsertBefore (target); var style = { Position:btn.css (' position '), display:btn.css (' Display '), Left:btn.css (' left ')};btn.appendto (' body '); Btn.css ({ Position: ' Absolute ', display: ' Inline-block ', left:-20000});} Btn._size (opts, parent), var left = Btn.find ('. L-btn-left '); Left.css (' Margin-top ', 0); Left.css (' Margin-top ', parseint ((Btn.height ()-left.height ())/2) + ' px '), if (!isvisible) {btn.insertafter (spacer); btn.css (style); Spacer.remove ();}}} var plugin = $.fn.linkbutton; $.fn.linkbutton = function (OptiONS, param) {if (typeof options! = ' string ') {return This.each (function () {Plugin.call (this), options, param); SetSize ( this);}); else {return Plugin.call (this, options, param);}}; $.fn.linkbutton.methods = Plugin.methods; $.fn.linkbutton.defaults = Plugin.defaults;$.fn.linkbutton.parseoptions = plugin.parseoptions; $.extend ($.fn.linkbutton.methods, {resize:function (JQ, param) {return Jq.each (function () {Setsiz         E (this, param);     }); } });}) (jQuery);(function ($) {var plugin = $.fn.dialog;$.fn.dialog = function (options, param) {var result = Plugin.call (this, Options, param), if (typeof options! = ' string ') {This.each (function () {var opts = $ (this). Panel (' Options '); if (IsNaN ( parseint (Opts.height)) {$ (this). CSS (' height ', ');} var onResize = Opts.onresize;opts.onresize = function (W, h) {Onresize.call (this, W, h); if (IsNaN (parseint (opts.height))) {$ (this). CSS (' height ', ');} var shadow = $.data (this, ' window '). Shadow;if (Shadow) {var cc = $ (this). Panel (' Panel '); shadow.CSS ({width:cc._outerwidth (), Height:cc._outerheight ()});}}; if (opts.closed) {var pp = $ (this). The Panel (' panel ');pp. Show (); $ (this). Panel (' resize ');pp. Hide ();}});} return result;}; $.fn.dialog.methods = Plugin.methods;$.fn.dialog.parseoptions = Plugin.parseoptions;$.fn.dialog.defaults = Plugin.defaults;}) (jQuery);(function ($) {function createtab (container, pp, options) {var state = $.data (container, ' tabs '); options = op tions | | {};//Create Panelpp.panel ({border:false,noheader:true,closed:true,dosize:false,iconcls: (Options.icon?             options.icon:undefined)}); var opts = Pp.panel (' options '); $.extend (opts, options, {onload:function () {             if (options.onload) {Options.onLoad.call (this, arguments); } state.options.onLoad.call (Container, $ (this));});     var tabs = $ (container). Children (' Div.tabs-header '). Find (' ul.tabs '); Opts.tab = $ (' <li></li> '). AppendTo (tabs);//Set the Tab object in panel Optionsopts.tab.append (' <A href= "javascript:void (0)" class= "Tabs-inner" > ' + ' <span class= ' tabs-title ' ></span> ' + ' <span class  = "Tabs-icon" ></span> ' + ' </a> '); $ (container). Tabs (' Update ', {tab:pp, options:opts}); } function AddTab (container, options) {var opts = $.data (container, ' tabs '). Options;var tabs = $.data (container, ' Ta     BS '). Tabs;     if (options.selected = = undefined) options.selected = true;     var pp = $ (' <div></div> '). AppendTo ($ (container). Children (' div.tabs-panels '));     Tabs.push (PP);     Createtab (container, pp, options);     Opts.onAdd.call (container, Options.title, tabs.length-1); $ (container). Tabs (' resize '), if (options.selected) {$ (Container). Tabs (' select ', tabs.length-1);}} $.extend ($.fn.tabs.methods, {add:function (JQ, Options) {return Jq.each (function () {AddTab (this, options),});});})             (jQuery);(function ($) {$.extend ($.fn.menubutton.methods, {enable:function (JQ) {return Jq.each (function () { $ (This). Data (' Menubutton '). options.disabled = false;$ (this). LinkButton (' Enable ');     }); } });})    (jQuery);(function ($) {var onafterrender = $.fn.datagrid.defaults.view.onafterrender; $.extend ($.fn.datagrid.defaults.view, {updaterow:function (target, RowIndex, row) {var opts = $.data (target, ' DataGrid ') ). Options;var rows = $ (target). DataGrid (' GetRows '); var oldstyle = _getrowstyle (RowIndex); $.extend (Rows[rowindex], row var NewStyle = _getrowstyle (RowIndex), var oldclassvalue = Oldstyle.c;var Stylevalue = Newstyle.s;var Classvalue = ' Datag Rid-row ' + (rowIndex% 2 && opts.striped? ' Datagrid-row-alt ': ') + newstyle.c;function _getrowstyle (rowIndex) {var css = Opts.rowstyler? Opts.rowStyler.call (Tar  Get, RowIndex, Rows[rowindex]): '; var classvalue = '; var stylevalue = '; if (typeof css = = ' string ') {stylevalue = CSS;} else if (CSS) {classvalue = Css[' class '] | | "; stylevalue = css[' Style" | | ‘‘;} return {c:classvalue, s:stylevalue};} function _update (frozen) {var fields = $ (Target). DataGrid (' Getcolumnfields ', frozen); var tr = opts.finder.getTr (target, RowIndex, ' body ', (frozen?1:2)); var Checked = Tr.find (' Div.datagrid-cell-check Input[type=checkbox] '). Is (': checked '); tr.html (The This.renderRow.call (this , target, fields, frozen, RowIndex, Rows[rowindex])), tr.attr (' style ', stylevalue). Removeclass (Oldclassvalue). AddClass (Classvalue); if (checked) {tr.find (' Div.datagrid-cell-check Input[type=checkbox] '). _propattr (' checked ', true);}} _update.call (this, true); _update.call (this, false); $ (target). DataGrid (' Fixrowheight ', RowIndex);}, Onafterrender:    function (target) {Onafterrender.call ($.fn.datagrid.defaults.view, target);    SetTimeout (function () {var opts = $ (target). DataGrid (' Options '); Opts.pagenumber = Opts.pagenumber | |    1;    },0); }}); $.fn.datagrid.defaults.loader = function (param, success, error) {var opts = $ (this). DataGrid (' Options '); if (!opts.u RL) return False;if (opts.pagination && Opts.pagenumber = = 0) {Opts.pagenumber = 1;param.page= 1;} if (Param.page = = 0) {return false;} $.ajax ({type:opts.method,url:opts.url,data:param,datatype: ' json ', success:function (data) {success (data);},error: function () {error.apply (this, arguments);}});};}) (jQuery);(function ($) {$.fn.numberbox.defaults.filter = function (e) {var opts = $ (this). Numberbox (' options '); var s = $ (     This). Numberbox (' GetText ');     if (E.which = =) {//-return (S.indexof ('-') = =-1? true:false);     } var c = String.fromCharCode (E.which);     if (c = = Opts.decimalseparator) {return (S.indexof (c) = =-1? true:false);     } else if (c = = Opts.groupseparator) {return true;  } else if ((E.which >= && e.which <=-&& E.ctrlkey = False && E.shiftkey = false) | | E.which = = 0 | |     E.which = = 8) {return true;     } else if (E.ctrlkey = = True && (E.which = = | | e.which = = 118)) {return true;     } else {return false; } };}) (JQuery);

Easyui DataGrid Request URL two times problem

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.