Opened 13 years ago
Closed 9 years ago
#6753 closed enhancement (fixed)
FilteringSelect: way of adding new items
Reported by: | guest | Owned by: | haysmark |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | Dijit - Form | Version: | 1.1.0 |
Keywords: | Cc: | alex, bill, Adam Peller | |
Blocked By: | Blocking: |
Description (last modified by )
I defined a FilteringSelect dijit in html (using option tags instead of a datastore.). I've discovered that it is not possible to add a new item to the filtering select after it has been parsed.
Something like dijit.byId('id').addItem(name, value) really needs to be added.
At the very least there needs to be a way to add an item to the underlying default datastore.
Change History (14)
comment:1 Changed 13 years ago by
Cc: | bill Adam Peller added; wildbill removed |
---|
comment:2 Changed 13 years ago by
comment:3 Changed 13 years ago by
Milestone: | → 1.3 |
---|---|
Owner: | set to nathan |
Summary: | FilteringSelect has no way of adding new items → FilteringSelect: way of adding new items |
Type: | defect → enhancement |
This boils down to implementing dojo.data.api.Write in dijit.form._ComboBoxDataStore (which would add requested feature for both ComboBox and FilteringSelect.
comment:4 Changed 13 years ago by
Owner: | changed from nathan to Nathan Toone |
---|
comment:5 Changed 12 years ago by
Milestone: | 1.3 → 1.4 |
---|
bumping 1.4 tickets to 1.5, and most 1.3 tickets to 1.4
comment:6 Changed 12 years ago by
Milestone: | 1.4 → future |
---|
comment:8 Changed 11 years ago by
Owner: | set to haysmark |
---|
I'll look at this. We have to implement:
- newItem
- deleteItem
- setValue
- setValues
- unsetAttribute
- save
- revert
- isDirty
The items are option tags, so newItem would expect at least the attributes "value" and "innerHTML". newItem would also mark new items as dirty. setValues would throw "feature not implemented." save would mark everything as clean and call both _saveEverything and _saveCustom like ItemFileWriteStore?. revert would throw out dirty items. isDirty would check for the dirt attribute. I think we can get away with a sufficiently small implementation that it won't severely impact the performance of existing users.
comment:9 Changed 11 years ago by
Are we going to have the new data api for 1.6? If so, maybe it would make more sense to implement adding new items using that api?
comment:10 Changed 11 years ago by
That's the plan, to have the new api in 1.6, so I agree it would make sense to follow that API.
comment:11 Changed 10 years ago by
I've got #12373 assigned to me for FilteringSelect to point to the new store API. (Feel free to grab it if you can get to it before me; it should be in 1.7 in either case.)
comment:12 Changed 10 years ago by
Component: | Dijit → Dijit - Form |
---|
comment:13 Changed 9 years ago by
Replying to guest:
I defined a FilteringSelect? dijit in html (using option tags instead of a datastore.). I've discovered that it is not possible to add a new item to the filtering select after it has been parsed.
Something like dijit.byId('id').addItem(name, value) really needs to be added.
At the very least there needs to be a way to add an item to the underlying default datastore.
This could be done in next way:
var a = dijit.byNode(yourWidgetNode); dojo.place('<option value="new">New Option</option>', a.store.root, 'last'); //adding dojo.destroy(dojo.query('[value="' + valueToRemove + '"]', a.store.root)[0]); //removing
a.store.root - simple html select with options and filtering select watches it.
comment:14 Changed 9 years ago by
Description: | modified (diff) |
---|---|
Milestone: | future → 1.7 |
Resolution: | → fixed |
Status: | new → closed |
Isn't this working already? dijit/form/DataList, the class used internally for inline <option> tags, extends dojo/store/Memory, so you should be able to add data to it, via myFilteringSelect.store.put(...).
I'll close this but if I misunderstood something you can reopen.
see #6029