[Kimchi-devel] [PATCH] [UI] Grid Enhancement - "title" Attribute for Long Values
Aline Manera
alinefm at linux.vnet.ibm.com
Tue Mar 11 17:42:32 UTC 2014
Reviewed-by: Aline Manera <alinefm at linux.vnet.ibm.com>
On 03/11/2014 07:09 AM, Hongliang Wang wrote:
> Allow programmer to specify whether to add a "title" attribute to a
> column if he/she is aware that the column may have very long value.
>
> Signed-off-by: Hongliang Wang <hlwang at linux.vnet.ibm.com>
> ---
> ui/js/src/kimchi.grid.js | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/ui/js/src/kimchi.grid.js b/ui/js/src/kimchi.grid.js
> index 20cacc5..215d6ea 100644
> --- a/ui/js/src/kimchi.grid.js
> +++ b/ui/js/src/kimchi.grid.js
> @@ -158,9 +158,13 @@ kimchi.widget.Grid = function(params) {
> var rowNode = $('<tr></tr>').appendTo(tbody);
> $.each(fields, function(fi, field) {
> var fieldName = field['name'];
> - $('<td><div class="cell-text-wrapper">' +
> - row[fieldName] +
> - '</div></td>').appendTo(rowNode);
> + var value = row[fieldName];
> + $('<td><div class="cell-text-wrapper"' +
> + (field['makeTitle'] === true
> + ? ' title="' + value + '"'
> + : ''
> + ) + '>' + value + '</div></td>'
> + ).appendTo(rowNode);
> });
> });
> };
More information about the Kimchi-devel
mailing list