Skip to content

Commit 85e58a3

Browse files
committed
Fixes #1 by adding a separate growlID
Renamed `growl` to `growlOptions` for consistency Also added s forced resizing of grid when switching tabs because sometimes the grid header would be hidden.
1 parent 72161ce commit 85e58a3

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

widgets/AttributesTable.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,13 @@ define([
237237
},
238238

239239
resizeChild: function (child, top, height, width) {
240-
node = child.domNode;
240+
var node = child.domNode;
241241
domStyle.set(node, 'top', (top - 1) + 'px');
242242
domStyle.set(node, 'height', (height - top) + 'px');
243243
domStyle.set(node, 'width', width + 'px');
244244

245-
if (child.resize) {
246-
child.resize();
245+
if (child.checkSizing) {
246+
child.checkSizing();
247247
}
248248

249249
// this gets the columns to resize properly

widgets/AttributesTable/Table.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ define([
7979
// allows for multiple instances of the widget, all subscribing to different topics
8080
topicID: 'attributesTable',
8181

82-
growl: {
83-
// track the growl
84-
id: null,
82+
// track the growl
83+
growlID: null,
84+
85+
growlOptions: {
8586
// should the loading growl be displayed?
8687
loading: true,
8788
// should the Results growl be displayed
@@ -251,10 +252,10 @@ define([
251252
},
252253

253254
clearGrowl: function () {
254-
var growl = registry.byId(this.growl.id);
255+
var growl = registry.byId(this.growlID);
255256
if (growl && growl.close) {
256257
growl.close();
257-
registry.remove(this.growl.id);
258+
registry.remove(this.growlID);
258259
}
259260
},
260261

@@ -267,6 +268,7 @@ define([
267268

268269
selectTab: function () {
269270
this.showAllGraphics();
271+
this.checkSizing();
270272
},
271273

272274
unselectTab: function () {
@@ -277,7 +279,7 @@ define([
277279
do some rather uncomfortable gymnastics to
278280
position the toolbar and grid components properly
279281
*/
280-
resize: function () {
282+
checkSizing: function () {
281283
var top = 0, cStyle;
282284
var tbNode = this.attributesTableToolbarDijit.domNode;
283285
var gridNode = this.attributesTableGridDijit.domNode;
@@ -293,7 +295,6 @@ define([
293295
}
294296
domStyle.set(gridNode, 'top', top + 'px');
295297

296-
/*
297298
var bodyNode = this.grid.bodyNode;
298299
var hdrNode = this.grid.headerNode;
299300
var ftrNode = this.grid.footerNode;
@@ -303,7 +304,6 @@ define([
303304
var ftrBox = domGeometry.getMarginBox(ftrNode, cStyle);
304305
domStyle.set(bodyNode, 'margin-top', (hdrBox.h + 1) + 'px');
305306
domStyle.set(bodyNode, 'margin-bottom', (ftrBox.h + 1) + 'px');
306-
*/
307307
},
308308

309309
// open the sidebar pane containing this widget (if any)

widgets/AttributesTable/_QueryMixin.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ define([
166166
q.relationshipId = qp.relationshipID;
167167
}
168168

169-
if (this.growl.loading && !this.isLinkedQuery) {
170-
this.growl.id = this.topicID + 'Growl-StartSearch';
169+
if (this.growlOptions.loading && !this.isLinkedQuery) {
170+
this.growlID = this.topicID + 'Growl-StartSearch';
171171
var msg = lang.mixin(this.i18n.messages.searching, {
172-
id: this.growl.id,
172+
id: this.growlID,
173173
timeout: (esriConfig.defaults.io.timeout + 5000),
174174
showProgressBar: true
175175
});
@@ -280,7 +280,7 @@ define([
280280
this.populateGrid(results);
281281
}
282282

283-
if (this.growl.results && !this.isLinkedQuery) {
283+
if (this.growlOptions.results && !this.isLinkedQuery) {
284284
this.openPane();
285285

286286
topic.publish('growler/growl', {

0 commit comments

Comments
 (0)