Updating indicator result with data from $.get (or $.ajax)

Comments

1 comment

  • Avatar
    Ravid Paldi

    Hi Tim,

     

    Few tips to get you started: 

    - Sisense's doesn't let you convert the event handlers to act as async functions. That means that if you're sending an ajax request from within an event, you can't know the exact time that the response code will be triggered. 

    - Therefore, it would be highly advised to try and avoid async calls from the event handlers where possible (trust me on this one, it frequently causes un expected behavior and it is a nightmare to debug it) 

    - You can use the global variable "prism" to get a lot of the data that you need so it will save you a lot of requests. Specificaly, to your case - run prism.activeDashboard.datasource to get a list of all the datasources that the dashboard is using and the "lastBuildTime" property to get their build time for you to use in your code (there are many other ways to get to that list by the way)

     

    With the above in mind, if all you're looking to achive is to have a label widget on the dashboard that present the last build time then you can easily creat a custom table in the cube with a single field and a single value that stores the currentTimestamp as its value. 

    Then use a BloX widget (or the old school Smart Label plugin) to pull that data and present it as you wish on the dashboard. 

     

    I hope it helped and feel free to reach out if you have any questions. We're always happy to help (: 

    Ravid

    ravid@paldi.solution

    Paldi Solutions 

    0
    Comment actions Permalink

Please sign in to leave a comment.