{"action":"created","issue":{"url":"https://api.github.com/repos/deitch/jstree-grid/issues/116","labels_url":"https://api.github.com/repos/deitch/jstree-grid/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/deitch/jstree-grid/issues/116/comments","events_url":"https://api.github.com/repos/deitch/jstree-grid/issues/116/events","html_url":"https://github.com/deitch/jstree-grid/issues/116","id":116333090,"number":116,"title":"Few improvements: line height, \"auto\" width, hover.","user":{"login":"side-by-side","id":7204866,"avatar_url":"https://avatars.githubusercontent.com/u/7204866?v=3","gravatar_id":"","url":"https://api.github.com/users/side-by-side","html_url":"https://github.com/side-by-side","followers_url":"https://api.github.com/users/side-by-side/followers","following_url":"https://api.github.com/users/side-by-side/following{/other_user}","gists_url":"https://api.github.com/users/side-by-side/gists{/gist_id}","starred_url":"https://api.github.com/users/side-by-side/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/side-by-side/subscriptions","organizations_url":"https://api.github.com/users/side-by-side/orgs","repos_url":"https://api.github.com/users/side-by-side/repos","events_url":"https://api.github.com/users/side-by-side/events{/privacy}","received_events_url":"https://api.github.com/users/side-by-side/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-11T13:07:24Z","updated_at":"2015-11-16T00:52:43Z","closed_at":null,"body":"Dear Avi, i have a few more improvements/fixes to the code. Check them out and decide, which of them should be in the base code.\r\n\r\n**1. line-height of the grid rows.**\r\nNow the line-height of the grid rows taken from the “line-height” css style from the first node.\r\nIf the contents of a node is multiline, its “line-height” doesn't represent real height anymore.\r\nI suggest this replacement to rely on the node actual “height” instead of “line-height”.\r\nhttps://github.com/deitch/jstree-grid/blob/master/jstreegrid.js#L228\r\nThis code:\r\n```javascript\r\nvar lh = this.element.find(\"li a:first\").css(\"line-height\");\r\n$('<style type=\"text/css\">td.jstree-grid-cell {line-height: '+lh+'}</style>').appendTo(\"head\");\r\n```\r\nCan be replaced with:\r\n```javascript\r\nvar anchorHeight = this.element.find(\"li a:first\").outerHeight();\r\n$('<style type=\"text/css\">td.jstree-grid-cell {line-height: '+anchorHeight+'px}</style>').appendTo(\"head\");\r\n```\r\n\r\n\r\n**2. Allowing use “auto” as default column width.**\r\nFor my personal use i had implement this. Maybe it will be useful for others.\r\nI don't now why the default width value is limited only to pixels, maybe there is some problems i haven't saw yet, but i'm using this successfully.\r\nTo have an ability to use “auto” as default width i edited these lines:\r\n* https://github.com/deitch/jstree-grid/blob/master/jstreegrid.js#L358.\r\nThe code:\r\n```javascript\r\nwidth -= borPadWidth;\r\n```\r\nreplaced with:\r\n```javascript\r\nif (width != 'auto') {\r\n\twidth -= borPadWidth;\r\n}\r\n```\r\n* https://github.com/deitch/jstree-grid/blob/master/jstreegrid.js#L679.\r\nThe code:\r\n```javascript\r\nwidth = tmpWidth || (width - paddingleft);\r\n```\r\nreplaced with:\r\n```javascript\r\nif (width != 'auto') {\r\n\twidth = tmpWidth || (width - paddingleft);\r\n}\r\n```\r\n\r\n**3. Hover whole row when mouse moves inside any grid column.**\r\nFor now the row hovered only when mouse enters the column with the jsTree (first usually) and not hovered when mouse enters some of the other columns.\r\nThe hover handler fixes this. You should add that handler somewhere in this function: https://github.com/deitch/jstree-grid/blob/master/jstreegrid.js#L762\r\n```javascript\r\nvar hoverInHandler = function (node, jsTreeInstance) {\r\n    return function() { jsTreeInstance.hover_node(node); }\r\n};\r\nvar hoverOutHandler = function (node, jsTreeInstance) {\r\n    return function() { jsTreeInstance.dehover_node(node); }\r\n};\r\nlast.hover(hoverInHandler(t, this), hoverOutHandler(t, this));\r\n```\r\nIn addition you could add mouse “pointer” while hovering grid columns."},"comment":{"url":"https://api.github.com/repos/deitch/jstree-grid/issues/comments/156880172","html_url":"https://github.com/deitch/jstree-grid/issues/116#issuecomment-156880172","issue_url":"https://api.github.com/repos/deitch/jstree-grid/issues/116","id":156880172,"user":{"login":"deitch","id":282526,"avatar_url":"https://avatars.githubusercontent.com/u/282526?v=3","gravatar_id":"","url":"https://api.github.com/users/deitch","html_url":"https://github.com/deitch","followers_url":"https://api.github.com/users/deitch/followers","following_url":"https://api.github.com/users/deitch/following{/other_user}","gists_url":"https://api.github.com/users/deitch/gists{/gist_id}","starred_url":"https://api.github.com/users/deitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deitch/subscriptions","organizations_url":"https://api.github.com/users/deitch/orgs","repos_url":"https://api.github.com/users/deitch/repos","events_url":"https://api.github.com/users/deitch/events{/privacy}","received_events_url":"https://api.github.com/users/deitch/received_events","type":"User","site_admin":false},"created_at":"2015-11-16T00:52:43Z","updated_at":"2015-11-16T00:52:43Z","body":"Nice bunch of them. They all seem to make sense at first blush. Why not make them 3 separate pull requests, I can review and pull them right in?"}}