FilteringSelect reset() issue

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

FilteringSelect reset() issue

augf87
Hi. I have a FilteringSelect that is attached to a JsonRestStore. Whenever I call reset() on the widget it triggers a fetch on the store, and later the select is populated with the first value fetched. Is this a correct behavior? What should I do to make the select show an empty value?

I searched through the API and forums but didn't find anyone having this issue.

Thanks in advance
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FilteringSelect reset() issue

neonstalwart
reset returns the input to it's original value.  If the original value when the input was created is empty then reset returns it to empty.  If the input was created with a value then reset returns the input to that value.

ben...



Sent from my Palm Pre on AT&T


On Oct 1, 2011 0:14, augf87 <[hidden email]> wrote:

Hi. I have a FilteringSelect that is attached to a JsonRestStore. Whenever I
call reset() on the widget it triggers a fetch on the store, and later the
select is populated with the first value fetched. Is this a correct
behavior? What should I do to make the select show an empty value?

I searched through the API and forums but didn't find anyone having this
issue.

Thanks in advance

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/FilteringSelect-reset-issue-tp3384353p3384353.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FilteringSelect reset() issue

augf87
The reset() method initially sets to the initial value (blank value), but also triggers a fetch on the store. When the fetch data arrives from the server, the select is populated and the first value fetched gets selected. This is the store and the select code:

var store = new dojox.data.JsonRestStore({
      target: this.url
});

var select = new dijit.form.FilteringSelect({
   name: "cars",
   value: "",
   store: store,
   searchAttr: "name
   }, "selectCar");

select.startup();


PD: Is there any other readonly store that fetches items with Json referencing like JsonRestStore? I'm using a JRS in this select (just for reading data) because it lets me make use of get('item') and pass that item to another JRS. I tried to use a ItemFileReadStore for the select but it handles items in a different way than the JRS...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FilteringSelect reset() issue

neonstalwart
I seem to remember that you might need to set the initial value to null (or maybe it needs to be undefined) - just don't provide a value property to the constructor and that should do it.

Take a look at the new dojo/store API for some alternative stores that might suit your needs.  Those stores don't transform their items.

ben...

Sent from my Palm Pre on AT&T


On Oct 1, 2011 11:51, augf87 <[hidden email]> wrote:

The reset() method initially sets to the initial value (blank value), but
also triggers a fetch on the store. When the fetch data arrives from the
server, the select is populated and the first value fetched gets selected.
This is the store and the select code:

var store = new dojox.data.JsonRestStore({
target: this.url
});

var select = new dijit.form.FilteringSelect({
name: "cars",
value: "",
store: store,
searchAttr: "name
}, "selectCar");

select.startup();


PD: Is there any other readonly store that fetches items with Json
referencing like JsonRestStore? I'm using a JRS in this select (just for
reading data) because it lets me make use of get('item') and pass that item
to another JRS. I tried to use a ItemFileReadStore for the select but it
handles items in a different way than the JRS...

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/FilteringSelect-reset-issue-tp3384353p3385241.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

________________________________________________________
Dojotoolkit: http://dojotoolkit.org
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api
Tutorials: http://dojotoolkit.org/documentation

[hidden email]
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FilteringSelect reset() issue

vtsuper
it seems the same case that I reported before. But my case happen on dojox.form.manager

http://bugs.dojotoolkit.org/ticket/13469
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FilteringSelect reset() issue

victoryismine06
I see this is an older thread, but I don't think there is a way to accomplish this using a declarative approach. I've tried a ton of combinations, but with the placeholder it doesn't seem possible. If I change this to a combobox it works just fine.


<input dojotype="dijit.form.FilteringSelect" name="whatever" store="myStore" searchattr="Text" autocomplete="true" queryExpr="${0}" pageSize="20" style="width: 20em;" required="false" data-dojo-props="placeHolder:'Type or Select...'"/>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FilteringSelect reset() issue

gilbertovtr
This post has NOT been accepted by the mailing list yet.
In reply to this post by augf87
Hello, I was setting 'undefined' in the property 'value' then when you invoque to method reset() It doesn't have that first value select, this functioned for me, I hope this helps you.

var filteringResources = new FilteringSelect({
   id: "Id"
   ,name: "name"
   ,value: undefined
   ,searchAttr: "name"
Loading...