An online demonstration is hosted on our servers at:http://demos.lightstreamer.com/DojoDemo/portfolio.html
Real-Time simulated Portfolio data is received from the Lightstreamer Server deployed @ http://push.lightstreamer.com.
To deploy the demo on your own environment follow the below instructions.
Before you can run the demo some dependencies need to be solved:
- Get the lightstreamer_namespace.js file from the latest Lightstreamer distribution and put it in the src folder of the demo. Alternatively you can build a lightstreamer_namespace.js file from the online generator. In that case be sure to include the LightstreamerClient, Subscription and StatusWidget modules and to use the "AMD with namespaced names" version.
- Download the Dojo Toolkit and copy the dojox folder from the package to the src folder of the demo. The demo requires the Dojo Toolkit v.1.8 or higher.
- Using the CommonJS Package Manager install dgrid, dijit and lightstreamer-store in the src folder; dependencies for these packages will be automatically resolved by the cpm process: cpm install dgrid cpm install dijit cpm install lightstreamer-store
The demo is now ready to be launched: navigate to src/index.html and enjoy.
Once the demo is working in your environment it is time to deploy it on a web server.
Before doing so it is suggested to compress the dojo/dojox/dijit files in a single js source file to minimize startup times:
Head for the Dojo Web Builder and select the following packages:
Then click the "build" button and wait. Once the builder is done a zip file will be dowloaded; copy the files/folders from the archive in the src/dojo foloder and reload the demo.
The demo currently connects to an online Lightstreamer demo server to get the stock data. It is possible to change this setting making the demo point to a different server. Obviously in this case the DEMO adapter needs to be installed on the tagert server (currently such adapter is installed by default). To change the server edit the index.js file and substitute the following line
var lsClient = new LightstreamerClient("http://push.lightstreamer.com","DEMO");
var lsClient = new LightstreamerClient(myServer,"DEMO");
where myServer contains the address of the server (comprehending the port if different from the default one). As an example, to connect to a local server listening on port 8080 use
var lsClient = new LightstreamerClient("http://localhost:8080","DEMO");
- If the user inputs any value in the dgrid and an update for that rows arrives from the store, the user's value is overwritten.
- If the user inputs any value and then presses + (to buy) or - (to sell) immediately after, the quantity field appears still empty and the first click fails.
- Lightstreamer - StockList Demo - Dojo Toolkit Client
- Lightstreamer - Portfolio Demos - HTML Clients
- Lightstreamer - Portfolio Demo - Flex Client
- LightstreamerStore for Dojo
- Compatible with Dojo Toolkit v.1.8 or newer.