Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#9694 closed enhancement (fixed)

Public API to change ItemFileReadStore url

Reported by: Josh Trutwin Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.4
Component: Data Version: 1.3.2
Keywords: clearOnClose Cc:
Blocked By: Blocking:

Description (last modified by bill)

Per #6073 there is a clearOnClose param since 1.2 that allows a data store to change URL's without having to create a new store. But for this to work you have to set a psuedo-private member of the class:

<div id="store" dojoType="" clearOnClose="true" url="/foo.php">


dijit.byId("store")._jsonFileUrl = "/bar.php";

Would it be possible to replace the first line with something like:


Or even:

dijit.byId("store").attr('url', '/bar.php');



Change History (5)

comment:1 Changed 12 years ago by Josh Trutwin

oops - please add code formatting wiki tags...

comment:2 Changed 12 years ago by bill

Description: modified (diff)

comment:3 Changed 12 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

This is already provided as of Dojo 1.4:

As for the secondary request for dijit.attr, that cannot be used. dijit.byId() works for widgets (classes that extend from dijit._Widget). None of the datastores extend from that class, they are not visual widgets, and therefore are not addressable by dijit.ById?(), nor would they have the attr function of dijit._Widget subclasses.

Anyway, long-winded comment on the dijit.ById? part, but as for setting the URL ,you already can:

storeInstance.url = <whatever>

The code has logic to trap that being reset, and if clearOnClose is true and close() was called, the new url value will be used.

So, already fixed.

comment:4 Changed 12 years ago by Josh Trutwin

Thanks for the nice comment - should've searched the bug database first. :(

Is .fetch(); needed still to automatically update the store after changing .url?

comment:5 Changed 12 years ago by Jared Jurkiewicz

Milestone: tbd1.4

The store will reload on the next call to fetch, either by a widget invoking it normally (As would ComboBox?, FilteringSelect?, etc, or by setting the query on grid, etc.).

Note: See TracTickets for help on using tickets.