Opened 12 years ago
Closed 11 years ago
#5430 closed defect (invalid)
Dojo Grid addRow generates editCell bug
Reported by: | guest | Owned by: | sorvell |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | DojoX Grid | Version: | 1.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
Dojo version: 1.0, but the same code exists in the current 1.02
Browsers: IE6, FF 2.0
Error message: "Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus."
Contact email: pservedio@…
I've just built a 6 page wizard that heavily uses the new Dojo Grid with various editors. When I try to add a row to the tables (programmtically through the grid.addRow method()), I'm getting a bug in both browsers, but IE is much more serious. FF seems to eat the exception gracefully, but IE hangs.
Using dojo uncompressed and the MS script debugger, I stumbled upon this little gem in Grid.js:
// begin editing row //FIXME: add to edit for(var j=0, c; ((c=this.getCell(j)) && !c.editor); j++){} if(c&&c.editor){ <b>this.edit.setEditCell(c, i);</b> }
IE seems to hang at the setEditCell() call, and that FIXME statement is perhaps a sign?
It is actually failing in dojox._grid.edit.start(...) and generates the error message as stated above.
Upon further thought, the code snippet doesn't make sense at all...why would one assume that the first editor based cell encountered in a newly added row should be placed into edit mode? I commented out all the code above and now addRow() works fine...
Here are the details of my code:
<b>var myView = { cells: [[ ... {name: 'Adjusted Start Price', width: "150px", headerStyles: 'font-weight: bold; font-size: 11px;text-align: center;', styles: 'font-family: Arial, Helvetica, sans-serif; font-size: 11px; text-align: right;', editor: dojox.grid.editors.Dijit, editorClass: 'dijit.form.CurrencyTextBox', formatter: formatMoney}, ... function formatMoney(inDatum) { return isNaN(inDatum) ? '' : wiz3currencySym + ' '+parseFloat(inDatum).toFixed(0); }
Here is how I'm adding the row, the variable's contents look fine (rawPrice, for example, maps to the currencyTextBox and is stringified number).
<b>// Add the row to the table var rowArray = new Array(' ', desc, qty, formatPrice, oh, rawPrice, newID, fileType); var pptTable = dijit.byId('wiz3PerPatTable'); pptTable.addRow(rowArray, pptTable.model.count); </b> </quote>
Change History (4)
comment:1 Changed 12 years ago by
Component: | Dojox → DojoX Grid |
---|---|
Description: | modified (diff) |
Owner: | changed from Adam Peller to sorvell |
comment:2 Changed 12 years ago by
comment:3 Changed 12 years ago by
Milestone: | → 1.2 |
---|---|
Priority: | high → normal |
comment:4 Changed 11 years ago by
Description: | modified (diff) |
---|---|
Resolution: | → invalid |
Status: | new → closed |
addRow doesn't modify the store anymore. Marking invalid.
this could be related to http://trac.dojotoolkit.org/ticket/5458#comment:1