1: I copied it (I can't think of any of it)--the pop-up window doesn't look good.
Extended $.extend ($.fn.datagrid.methods, {/** * cue feature * @param {} JQ * @param {} params the style of the prompt message box * @return {} */DoC
Elltip:function (JQ, params) {function Showtip (data, TD, E) {if ($ (TD). Text () = "") return; Data.tooltip.text ($ (TD). Text ()). CSS ({top: (e.pagey +) + ' px ', Left: (E.pagex +) + ' px ', ' z-index ': $.fn.windo
W.defaults.zindex, display: ' Block '};
};
Return Jq.each (function () {var Grid = $ (this);
var options = $ (this). Data (' DataGrid ');
if (!options.tooltip) {var panel = Grid.datagrid (' Getpanel '). Panel (' Panel '); var defaultcls = {' border ': ' 1px solid #333 ', ' padding ': ' 1px ', ' Color ': ' #333 ', ' background ': ' #f7f5d1 ', ' posit Ion ': ' absolute ', ' max-width ': ' 200px ', ' Border-radius ': ' 4px ', '-moz-border-radius ': ' 4px ', '-webkit-border-radiu
S ': ' 4px ', ' Display ': ' None '} var tooltip = $ ("<div></div>"). Appendto (' body ');
Tooltip.css ($.extend ({}, Defaultcls, params.cls));
Options.tooltip = tooltip; Panel.find ('. daTagrid-body '). each (function () {var Delegateele = $ (this). Find (' > Div.datagrid-body-inner '). Length? $ (this). Find ('
> Div.datagrid-body-inner ') [0]: this; $ (Delegateele). Undelegate (' TD ', ' MouseOver '). Undelegate (' TD ', ' Mouseout '). Undelegate (' TD ', ' MouseMove '). Delegate (
' TD ', {' mouseover ': function (e) {if (Params.delay) {if (options.tipdelaytime) cleartimeout (options.tipdelaytime);
var that = this;
Options.tipdelaytime = settimeout (function () {Showtip (options, that, e);
}, Params.delay);
else {showtip (options, this, e);
}, ' Mouseout ': function (e) {if (options.tipdelaytime) cleartimeout (options.tipdelaytime);
Options.tooltip.css ({' Display ': ' None '});
}, ' MouseMove ': function (e) {var = this;
if (options.tipdelaytime) {cleartimeout (options.tipdelaytime);
Options.tipdelaytime = settimeout (function () {Showtip (options, that, e);
}, Params.delay);
else {showtip (options, that, e);
}
}
});
});
}
}); /** * Turn off the message prompt feature
* @param {} JQ * @return {}/cancelcelltip:function (JQ) {return Jq.each (function () {var data = $ (this). Data (' d
Atagrid ');
if (data.tooltip) {data.tooltip.remove ();
Data.tooltip = null;
var panel = $ (this). DataGrid (' Getpanel '). Panel (' Panel '); Panel.find ('. Datagrid-body '). Undelegate (' TD ', ' MouseOver '). Undelegate (' TD ', ' Mouseout '). Undelegate (' TD ', '
MouseMove ')} if (Data.tipdelaytime) {cleartimeout (data.tipdelaytime);
Data.tipdelaytime = null;
}
}); }
});
Call Method 1:
function Docelltip () {
$ (' #dg '). DataGrid (' Docelltip ', {' max-width ': ' 100px '});
function Cancelcelltip () {
$ (' #dg '). DataGrid (' Cancelcelltip ');
Call Method 2:
Onloadsuccess:function (data) {
$ (' #dg '). DataGrid (' Docelltip ', {cls:{' background-color ': ' Red '},delay:1000});
The above is a small set to introduce the Easyui of the Docelltip implementation of the mouse to put the cell on the prompt cell content, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!