Opened 12 years ago
Closed 11 years ago
#10069 closed enhancement (worksforme)
dojox.grid.cells.NumberTextBox will be nice to have
Reported by: | Marcin Gołębski | Owned by: | Nathan Toone |
---|---|---|---|
Priority: | high | Milestone: | 1.4 |
Component: | DojoX Grid | Version: | 1.3.2 |
Keywords: | DataGrid edit number | Cc: | |
Blocked By: | Blocking: |
Description
It will be nice to have cellType which accepts only number, like dijit.form.NumberTextBox?
Attachments (2)
Change History (15)
Changed 12 years ago by
Attachment: | dojox.grid.tests.test_data_grid_edit_dijit.patch added |
---|
comment:1 Changed 12 years ago by
Component: | General → DojoX Grid |
---|---|
Owner: | changed from anonymous to Nathan Toone |
comment:3 follow-ups: 4 5 Changed 12 years ago by
Replying to toonetown:
Have you signed a cla?
No, I haven't. How can I do this? The second question: why milestone 1.5 not trunk?
comment:4 follow-up: 11 Changed 12 years ago by
Have you signed a cla?
No, I haven't. How can I do this?
OK, I know it. I will send it this weekend.
comment:5 Changed 12 years ago by
Replying to mgolebsk:
why milestone 1.5 not trunk?
Since we don't have a CLA yet from you, you said you'll get it in this weekend, but we are cutting the 1.4 beta this weekend...and no new features will be going in. I can get it into the trunk as soon as we release 1.4 (thus it will be available for 1.5).
Even if the CLA were in now, I am a bit wary of adding any new features this close to a release...so the change would still be in for 1.5.
comment:6 follow-up: 8 Changed 12 years ago by
As the patch indicates, you can already do this with a _Widget cell+widgetClass=NumberTextBox? very compactly. You don't even need the get/setValue definitions because if you type something invalid, the NumberTextBox? just stays open.
comment:7 follow-up: 9 Changed 12 years ago by
For instance, we have a CurrencyTextBox? declared in a grid structure that is simply:
{ name: 'Amount', field: 'col5', formatter: formatCurrency, constraint: {currency: 'EUR'}, widgetClass: dijit.form.CurrencyTextBox },
It seems overkill to add a separate NumberTextBox? definition given that CurrencyTextBox? works fine without its own definition.
comment:8 Changed 12 years ago by
Replying to haysmark:
As the patch indicates, you can already do this with a _Widget cell+widgetClass=NumberTextBox? very compactly. You don't even need the get/setValue definitions because if you type something invalid, the NumberTextBox? just stays open.
Two cases:
- when NumberTextBox? cell you enter character then widget stays open until it deletes
- when you enter out of ranges value and then pres enter - the new incorrect value will be send to the Store.
That's why get/setValue is necesary.
comment:9 Changed 12 years ago by
Replying to haysmark: It does not work when you use pure html grid definition, eg:
<th field="minH" editable="true" widgetClass="dijit.form.NumberTextBox" constraint="{min:0, max:9999999}">Min H</th>
the efect is simple edit cell which accespts all character.
Changed 12 years ago by
Attachment: | dojox.grid.cells.digit.patch added |
---|
patch which adds NumberTextBox?
comment:10 follow-up: 12 Changed 12 years ago by
You're right, I looked at the source I pulled that from and what I posted was not the whole story. It turned out there was a defaultCell being set that was specifying type: dojox.grid.cells._Widget.
We have an example of creating such a cell in markup (although it is acting up ATM):
http://archive.dojotoolkit.org/nightly/checkout/dojox/grid/tests/robot/_DataGrid.html
If you look at the source for that page, the equivalent HTML to what I posted above, with the defaultCell flattened into the definition, is:
<th cellType="dojox.grid.cells._Widget" widgetClass="dijit.form.CurrencyTextBox" field="col5" formatter="formatCurrency" constraint="{currency:'EUR'}" editable="true" width="8em" styles='text-align: right;'>Amount</th>
I would encourage you to try it. For the problem number 2 you were describing, that sounds like a bug with Grid using RangeBoundTextBox?, which we should fix for all widgets, not just this one.
comment:11 Changed 11 years ago by
comment:12 follow-up: 13 Changed 11 years ago by
Replying to haysmark:
<th cellType="dojox.grid.cells._Widget" widgetClass="dijit.form.CurrencyTextBox" field="col5" formatter="formatCurrency" constraint="{currency:'EUR'}" editable="true" width="8em" styles='text-align: right;'>Amount</th>I would encourage you to try it.
Yes, it works fine.
For the problem number 2 you were describing, that sounds like a bug with Grid using RangeBoundTextBox?, which we should fix for all widgets, not just this one.
Maybe we shoud create another ticket for this issue and close this one?
comment:13 Changed 11 years ago by
Milestone: | 1.5 → 1.4 |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
Replying to mgolebsk:
Maybe we shoud create another ticket for this issue and close this one?
Yes - please open another ticket for that issue. I will close this one as worksforme since the original issue appears to be working now.
test for NumberTextBox?