Opened 8 years ago

Closed 7 years ago

#13943 closed defect (patchwelcome)

DataGrid does not render data after setStore()

Reported by: veronika81 Owned by: Evan
Priority: high Milestone: tbd
Component: DojoX Grid Version: 1.6.1
Keywords: DataGrid setStore render Cc:
Blocked By: Blocking:

Description

Hello everybody,

there has appeared a phenomena that I would like to report when combining DataGrid? with Tabs.

The issue could be simply described so that a DataGrid? does not render any content after setting a datastore with grid.setStore() under certain conditions. The conditions are the following in conjunction:

  • the grid is in a tab which had not been chosen for display when setStore() was called,
  • the tab has been created in an onclick or subscribe/publish callback in contrast with a tab created directly in dojo.ready() callback.

The code for inspection in a minimal setting is available at:

http://veronika.kolovratnik.net/tmp/dojo/tab-test2.html http://veronika.kolovratnik.net/tmp/dojo/grid-test.html

tab-test2.html demonstrates the issue. Click twice to any new tab button, switch to a new tab, click populate button and see grids in which tabs got populated with data.

grid-test.html is here to show that grids created in an onclick or subscribe/publish callback behave right when not hidden in a tab.

A few of notes: All the data stores takes data, the grid just does not display them. If a tab is created in dojo.ready and subscribed for the event in an onclick callback, the grid displays data. The other suspicious thing is that resizing of columns only resizes the header but not the data columns in grids created in an onclick callback. It can be tested in both pages. The data cell remain unresized until e.g. user clicks for sorting the column.

I would be happy for ideas whether the phenomena is intended and all right or whether in might be a bug. Since I am new to DoJo?, going to its code and figuring out what is going on seems quite difficult for me as I only see identifiers like _94.

With regards David

Change History (4)

comment:1 Changed 8 years ago by veronika81

Tested in Google Chrome 13 and FireFox? 3.5.16.

comment:2 Changed 8 years ago by Bitt

I observe what I believe is the same bug, but I only observe it on IE (only checked IE8). If I do a setStore on a datagrid on a different tab, I get error message in console:

Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus

I did some research some days ago, and I think IE returns an exception from the setFocus function (but I might remember incorrectly) where other browsers just return false. A try { } catch in the right place should fix the problem.

comment:3 Changed 7 years ago by bill

DojoX Grid and EnhancedGrid are deprecated in favor of dgrid and gridx.

You should upgrade your code to use one of those two grids.

We will consider patches to the old DojoX Grid code though.

comment:4 Changed 7 years ago by bill

Resolution: patchwelcome
Status: newclosed
Note: See TracTickets for help on using tickets.