Opened 15 years ago
Closed 14 years ago
#1186 closed enhancement (fixed)
[patch][cla] widget: ComboBox, allow data to be passed directly(instead of by URL/option tags).
Reported by: | Owned by: | Douglas Hays | |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Widgets | Version: | 0.2 |
Keywords: | combobox widget | Cc: | |
Blocked By: | Blocking: |
Description
Below is an SVN diff from rev 4965, for allowing data to be passed directly, instead of requiring a dataUrl, or as options to a combobox widget.
You can see this in action(example HTML/JS code) at: http://www.yuma.ca/tech/js/testWidget.html
I didn't see any notes on the developer page of how to submit patches/enhancement requests. If this is not the right way please let me know.
Index: src/widget/ComboBox.js =================================================================== --- src/widget/ComboBox.js (revision 4965) +++ src/widget/ComboBox.js (working copy) @@ -77,7 +77,11 @@ this.init = function(cbox, node){ if(!dojo.string.isBlank(cbox.dataUrl)){ this.getData(cbox.dataUrl); - }else{ + } + else if(dojo.lang.isArray(cbox.data)){ + this.setData(cbox.data); + } + else{ // check to see if we can populate the list from <option> elements if((node)&&(node.nodeName.toLowerCase() == "select")){ // NOTE: we're not handling <optgroup> here yet @@ -239,6 +243,7 @@ searchTimer: null, searchDelay: 100, dataUrl: "", + data: "", fadeTime: 200, // maxListLength limits list to X visible rows, scroll on rest maxListLength: 8,
Change History (8)
comment:1 Changed 14 years ago by
Summary: | widget: ComboBox, allow data to be passed directly(instead of by URL/option tags). → [patch] widget: ComboBox, allow data to be passed directly(instead of by URL/option tags). |
---|
comment:2 Changed 14 years ago by
Summary: | [patch] widget: ComboBox, allow data to be passed directly(instead of by URL/option tags). → [patch][need cla] widget: ComboBox, allow data to be passed directly(instead of by URL/option tags). |
---|
No CLA on file, any chance we can get a CLA for this one? http://dojotoolkit.org/foundation/
comment:4 Changed 14 years ago by
My employer Yuma Union High School District should have a CLA on file with you guys now.
comment:5 Changed 14 years ago by
Summary: | [patch][need cla] widget: ComboBox, allow data to be passed directly(instead of by URL/option tags). → [patch][cla] widget: ComboBox, allow data to be passed directly(instead of by URL/option tags). |
---|
Updated to show CLA on file. -> Yuma Union High School District #70
comment:6 Changed 14 years ago by
Owner: | changed from bill to Douglas Hays |
---|
comment:7 Changed 14 years ago by
You can use the data property to assign data directly. For example:
new dijit.form.AutoCompleter?({data:{items:[{name:"California"}]}, name:"prog",autocomplete:false,searchField:"name"}, document.getElementById("progCombo"));
need to verify that we have a cla on file, http://dojotoolkit.org/foundation/