From 8ce25e6a20c580e38d6464d09a90ebefa18f66ef Mon Sep 17 00:00:00 2001 From: Simon Speich Date: Fri, 5 Jul 2013 19:49:42 +0200 Subject: [PATCH 1/2] explicit use of tag name td replaced with dojo/query call to allow for any kind of cell container --- Grid.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Grid.js b/Grid.js index 706de13eb..7c52f8d12 100644 --- a/Grid.js +++ b/Grid.js @@ -1,5 +1,5 @@ -define(["dojo/_base/kernel", "dojo/_base/declare", "dojo/on", "dojo/has", "put-selector/put", "./List", "dojo/_base/sniff"], -function(kernel, declare, listen, has, put, List){ +define(["dojo/_base/kernel", "dojo/_base/declare", "dojo/on", "dojo/has", "put-selector/put", "./List", "dojo/query", "dojo/_base/sniff"], +function(kernel, declare, listen, has, put, List, query){ var contentBoxSizing = has("ie") < 8 && !has("quirks"); var invalidClassChars = /[^\._a-zA-Z0-9-]/g; function appendIfNode(parent, subNode){ @@ -57,13 +57,7 @@ function(kernel, declare, listen, has, put, List){ var row = this.row(target), rowElement = row.element; if(rowElement){ - var elements = rowElement.getElementsByTagName("td"); - for(var i = 0; i < elements.length; i++){ - if(elements[i].columnId == columnId){ - element = elements[i]; - break; - } - } + element = query('.field-' + columnId, rowElement)[0]; } } if(target != null){ From af968f5d1babef8e4db838e733e2f1c4c18831ab Mon Sep 17 00:00:00 2001 From: Simon Speich Date: Thu, 11 Jul 2013 21:36:44 +0200 Subject: [PATCH 2/2] removed some unused variables --- Grid.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/Grid.js b/Grid.js index 7c52f8d12..121ab44d6 100644 --- a/Grid.js +++ b/Grid.js @@ -39,7 +39,6 @@ function(kernel, declare, listen, has, put, List, query){ } var element; if(target.nodeType){ - var object; do{ if(this._rowIdToObject[target.id]){ break; @@ -83,7 +82,6 @@ function(kernel, declare, listen, has, put, List, query){ // summary: // Generates the grid for each row (used by renderHeader and and renderRow) var row = put("table.dgrid-row-table[role=presentation]"), - cellNavigation = this.cellNavigation, // IE < 9 needs an explicit tbody; other browsers do not tbody = (has("ie") < 9 || has("quirks")) ? put(row, "tbody") : row, tr, @@ -172,7 +170,6 @@ function(kernel, declare, listen, has, put, List, query){ // Setup the headers for the grid var grid = this, - columns = this.columns, headerNode = this.headerNode, i = headerNode.childNodes.length;