Easyui DataGrid method Extension-ToolTip

Source: Internet
Author: User

The latest version of the jquery Easyui a new component called ToolTip, which is the prompt box. The previous version did not have this component when there are a lot of questions in the cell of the DataGrid, I want to add a mouse to prompt how to do. Originally I told them the method is to use formatter, the approximate method is as follows:

Formatter:function (value) {    return ' <span title= ' +value+ ' "> ' +value+ ' <span> ';}

  

In this way, the browser's own title feature is used to achieve the display effect. But the effect of this is not very much thinking. Thankfully, with the ToolTip component from the 1.3.3+ version, I can further customize our cue message.

The specific extension methods are as follows:

/** * DataGrid extension method tooltip based on Easyui 1.3.3, can be used for easyui1.3.3+ * Simple implementation, for advanced features, You can freely modify * instructions: * After easyui.min.js import this JS * code case: *$ ("#dg"). DataGrid ({...}). DataGrid (' ToolTip '); All Columns *$ ("#dg"). DataGrid ({...}). DataGrid (' tooltip ', [' ProductID ', ' ListPrice '); Specify column * @author ____′ Shahi */$.extend ($.fn.datagrid.methods, {tooltip:function (JQ, fields) {return Jq.each (function () {var Panel = $ (this). DataGrid (' Getpanel '), if (Fields && typeof fields = = ' object ' && fields.sort) {$.each (Fiel DS, Function () {var field = this;bindevent ($ ('. Datagrid-body td[field= ' + field + ']. Datagrid-cell ', panel));}); else {bindevent ($ (". Datagrid-body. Datagrid-cell", panel));}); function Bindevent (JQS) {jqs.mouseover (function () {var content = $ (this). text (); $ (this). ToolTip ({content:content, Trackmouse:true,onhide:function () {$ (this). ToolTip (' Destroy ');}}). ToolTip (' Show ');}}); 

Original address: Http://www.jeasyuicn.com/the-extended-datagrid-method---tooltip.html

Easyui DataGrid method Extension-ToolTip

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.