Opened 14 years ago
Closed 14 years ago
#2441 closed enhancement (wontfix)
Allow empty values for inline edit box
Reported by: | Owned by: | Douglas Hays | |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Dijit | Version: | 0.4.1 |
Keywords: | inlineEditBox | Cc: | |
Blocked By: | Blocking: |
Description
Currently, the inlineEditBox widget does not allow for empty values. Most of the time, this is desired, but sometimes, it is not. I altered my copy of dojo to have a 'required' variable with a default of true. Then altered the 'saveEdit' and 'checkForValueChange' functions accordingly. That way I can set it to false when i want to allow empty values.
You can see my edits here: http://infinitysphere.no-ip.org/wsvn/foobar/trunk/dojo_svn_20070124/src/widget/InlineEditBox.js?op=file&rev=2&sc=0
Also, it would be nice if it checked the return value on the onSave handler. This would allow people to validate the new value.
Change History (4)
comment:1 Changed 14 years ago by
comment:3 Changed 14 years ago by
Component: | Widgets → Dijit |
---|---|
Milestone: | → 0.9 |
Owner: | changed from bill to Douglas Hays |
comment:4 Changed 14 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
The InlineEditBox? widget was rewritten for 0.9. Empty values are allowed now. An ampty value is displayed as a single ? so that it can be clicked and edited. All widgets that inherit from Textbox can be used as the editing widget and they all support the required attribute. Ths change will not be backported to 0.4.x.
I made the changes to cancel the save if onSave returns false:
http://infinitysphere.no-ip.org/wsvn/foobar/trunk/dojo_svn_20070124/src/widget/InlineEditBox.js?op=file&sc=1&rev=8
On the webpage, instead of "event.connect(inlineEditBoxNode,'onSave',saveFunc)" I had to overwrite the onSave function with "inlineEditBoxNode.onSave = saveFunc"