// define app, include Wijmo 5 directives
var app = angular.module('app', ['wj']);
// controller
app.controller('appCtrl', function($scope) {
$scope.grid = null;
var tooltip = new wijmo.Tooltip();
$scope.onMouseOver = function(e) {
if ($scope.grid)
{
var hti = $scope.grid.hitTest(e);
if(hti.panel && hti.panel.cellType === wijmo.grid.CellType.ColumnHeader) {
var header = hti.panel.getCellData(hti.row, hti.col, false);
var ele = hti.panel.getCellElement(hti.row, hti.col);
//Some Custom Logic Required as Tooltips dynamcially loading
for (var i = 0; i < $scope.grid.columns.length; i++) {
if ($scope.grid.columns[i].header === header) {
tooltip.show(ele, $scope.grid.columns[i].header); //Instead of header content I am using i.e this.$scope.ctx.columns[i].tooltipcolumn
return;
}
}
}
else {
tooltip.dispose();
}
}
}
//Here I am using MouseLeave since, my Version is Diferent.
$scope.onMouseLeave = function(e) {
tooltip.dispose();
}
// create some random data
var countries = 'US,Germany,UK,Japan,Italy,Greece'.split(','),
data = [];
for (var i = 0; i < 200; i++) {
data.push({
country: countries[i % countries.length],
downloads: Math.round(Math.random() * 20000),
sales: Math.random() * 10000,
expenses: Math.random() * 5000
});
}
// expose data as a CollectionView to get events
$scope.data = new wijmo.collections.CollectionView(data);
$scope.autoSize = function() {
$scope.grid.autoSizeRows();
$scope.grid.autoSizeColumns();
}
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.