193. /**
194. * Loads the data to apply to the tip template via Ajax 195. *
196. * @private
197. * @param {object} data Parameters for the Ajax request 198. * @param {Ext.ToolTip} tip The tooltip object 199. * @param {Ext.grid.GridPanel} grid The grid
200. * @param {Ext.ux.plugins.grid.CellToolTips} ctt The CellToolTips objec
t
201. * @param {String} tipid Id of the tooltip (= field name) 202. */
203. ,loadDetails: function(data, tip, grid, ctt, tipid) { 204. Ext.Ajax.request({
205. url: ctt.tipUrls[tipid], 206. params: data, 207. method: 'POST',
208. success: function(resp, opt) { 209. tip.finished = true;
210. tip.tipdata = Ext.decode(resp.responseText); 211. tip.show(); 212. } 213. }); 214. } 215.
216. }); // End of extend
[javascript] view plaincopy
1. //当鼠标滑到项目名称,计划字段的时候(LogText),显示任务内容的详细信息 2. /*
3. http://www.sencha.com/forum/showthread.php?59895-Ext.ux.plugins.grid.CellTo
olTips&highlight=Extjs+grid+Tip 4. */
5. var cellTips = new Ext.ux.plugins.grid.CellToolTips 6. ( 7. [
8. { field: 'ProjectName', tpl: '项目名称:{ProjectName}
责任
人:{LiabilityMan}
计划完成时间:{LogDate}
任务内容: {Remark}' }, 9. { field: 'LogText', tpl: '项目名称:{ProjectName}
责任
人:{LiabilityMan}
计划完成时间:{LogDate}
任务内容: {Remark}' } 10. ] 11. );
Grid中添加插件
[javascript] view plaincopy
1. var grid = new Ext.grid.GridPanel 2. ({
3. id: \, 4. title: '任务列表', 5. renderTo:\, 6. layout: \, 7. width: \, 8. autoHeight: true, 9. frame: true, 10. border: true, 11. columnLines: true, 12. autoScroll: true,
13. loadMask: {msg:'正在加载数据,请稍侯……'}, 14. store: store, 15. sm: sm, 16. cm: cm,
17. plugins: [ cellTips ]//这是这个代码 18. ... 19. })