add js code to construct the dashboard obj