Refeshing an ItemFileReadStore

A Short Guide On Binary Trading Robots

 

In the binary trading sector, you can trade different types of assets, but the dominant categories are stocks, commodities, currency pairs, and indices. Since the prices of these assets are in constant and highly unpredictable movement, it can be tough to make accurate calls and earn a lot of money in the binary world. Also, a lot of dedication and effort is required to perform an analysis of those fluctuations of prices, and many investors simply do not have enough free time for this activity. That is why auto-trading programs can be of great importance, and millions of traders are incorporating binary robots into their daily trading sessions.

 

How Do Binary Robots Actually Work?

 

Fintech Ltd is a notable example of a binary robot that operates in a legitimate and professional manner, and this program is growing in popularity in the recent period. In essence, all automated software products work in the same way – they monitor the markets and place the trades on behalf of the user. To be more precise, these programs are relying on sophisticated algorithms to analyze a complex set of technical indicators and past performances, finding the patterns that could predict future movements of the prices. When the system generates those suitable investment opportunities, it places the trades in agreement with the user’s trading strategy. It is vital that the user establishes the proper settings, such as daily limits, and these safety features will minimize the risks and offer a safer trading experience.

by Gary Acord

This is a pretty common need with a pretty simple solution.  How do you clear out the existing Data in a store, and populate it with new Data in Dojo 1.2?

The solution is pretty easy. Let’s assume you have an ItemFileReadStore (this works with ItemFileWriteStore as well) named myStore.

<div dojoType="dojo.data.ItemFileReadStore" url="myData.json" id="myStore" jsid="myStore" clearOnClose="true"></div>

This creates an ItemFileRead store and assigns it to the global variable myStore.

Then you can force it to reload as such:

myStore.close();
myStore.fetch();

If you need to change the url of the store (as of Dojo 1.2.3) you can do it like this:

myStore.close();
myStore._jsonFileUrl = newurl;
myStore.fetch();

… and if you have a grid bound to the store, force it to reload

myStore.close();
myStore.fetch();
myGrid._refresh();

And that’s all there is to it.  Happy Dojoing!

About:
Website: http://

 

This entry was posted on Saturday, January 31st, 2009 at 10:53 pm and is filed under Dojo Cookies. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

3 Responses to “Refeshing an ItemFileReadStore”

  1. bngsudheer Says:
    This is cool. I was looking at queryReadStore to achieve this functionality with autocomplete fields. Happy to know I don’t have to for small lists.
  2. dcremo Says:
    Hello. I’m trying to do the same thing with a dijit.Tree bound to a ForestStoreModel bound to ItemFileWriteStore from a JSON Url, but I cannot see the updated data.
    Looking to the 1.2.3 (and even in 1.3.1) sources I can’t see any tree._refresh() or similar function. Any help is much appreciated.
  3. viro Says:
    Using Dojo 1.3.1, I’m using this method to refresh a store bound to a grid. The new url points to a php scripts that queries data. All of this works fine but for a small yet annoying glitch :The grid size ( height ) grows everytime I try to reload the store. It grows with blank space, not new content ( the php script returns only one line to be displayed in the grid anyways)

    The store does have the clearonclose flag set to true, if that’s of any importance.

    Here are the store and grid :

    and here is the function to reload :

    function majTable(param)
    {
    jsonStore.close();
    jsonStore._jsonFileUrl = “ventes.php?”+param;
    jsonStore.fetch();
    myGrid._refresh();
    }

    Any help is much appreciated !