Store Axios data into Global Variable - vue.js

I am trying to store the response data from an axios call into a global variable permenantly instead of it being called every time upon refresh. Since the json file is pretty large it takes the site around 2-4 seconds to load and I want this to only load once on start up

You have multiple choices :
You can use a store, like vuex : https://vuex.vuejs.org/fr/guide/
Which allow your to store datas in an object outside of your component and call il from where you want
If it is a paginated list, you can use a dynamic pagination to load chunks of your datas :
Imagine, you have 10000 items, your user can only see 20 items per page, so just load 5 first pages, and each time the user click on next button, load 20 next elements (It's an exemple, you can improve it at your convinience)
Or your can combine both ;)

Related

Retrieving data from multiple-page API using Talend

I have an API with 59 pages, on each page 1000 rows of data. I would like to retrieve all that data and store it in a Microsoft SQL Server.
When I use tloop with a condition run until i<59, it returns the first 1000 rows of data 59 times which is clearly not what I need.
I have tried to create a global variable next_page but I do not know how to connect it to the next_page present in the API, so that when "next_page"="" the program will know to break the loop.
I had a similar case (difference is that I didn't have a "nextPage" element but a "nextLink" which was giving me the complete URL to get to the nextPage).
I created a globalvariable "endJob" with value "false" at the beginning (tJava right before tLoop)
My tLoop is from int i=1, iteration is i++ , condition is !endJob (thus it will loop as long as the job is not marked as ended).
In a tJava right after tLoop, create the URL for your API request, using your page number, which is the tLoop_1_CURRENT_ITERATION
Then after my tRestClient, I put a tReplicate : first flow is for your needed transformations, the other one retrieve only the "nextPage" item. If nextPage is empty, then you update "endJob" variable to "true" : you want to stop the loop.

How can i manage a global variable among different webpages in wix?

I am developing a site for online test series. I receive details o student on one page and wish to display the info on net page as dashboard. I need a global variables that can hold the detail of student like his roll no, name, email, class, semester, subject and the test he wishes to solve.
I have tries using a separate .js file to hold variables. However, the values of variables get lost as i move to next page.
can anyone help?
The code and links are attached.
https://ishuuw.wixsite.com/ymatutor/test-series
//import wixData from 'wix-data';
import {globalVars} from 'public/vars.js';
$w.onReady(function () {
});
export function button2_click(onClick,button2){
globalVars.StudentRoll=$w('#input1').value
globalVars.StudentName=$w('#input5').value
globalVars.StudentSurname=$w('#input6').value
globalVars.StudentMail=$w('#input7').value
globalVars.StudentClass=$w('#dropdown1').value
globalVars.StudentYear=$w('#dropdown2').value
globalVars.StudentSemester=$w('#dropdown3').value
globalVars.StudentPaper=$w('#dropdown5').value
globalVars.StudentTest=$w('#dropdown6').value
//Just to test, this works well
$w('#text63').text=globalVars.StudentRoll
$w('#text64').text=globalVars.StudentName
$w('#text65').text=globalVars.StudentSurname
$w('#text66').text=globalVars.StudentMail
$w('#text67').text=globalVars.StudentClass
$w('#text68').text=globalVars.StudentYear
$w('#text69').text=globalVars.StudentSemester
$w('#text70').text=globalVars.StudentPaper
$w('#text71').text=globalVars.StudentTest
}
`
Sounds like you should be using wix-storage. That will allow you to pass information between pages.
Use local storage if you want the data to persist for the user even after the user ends the session. Meaning, next session, the user's data will still be available.
Use session storage if you want the data to be removed when the user's session ends.

Reload just one tab in Qlikview

How can we reload one tab , means one request of many in QLikview.
PS:
I have one request per tab
Help appreciated
Thank you
If you are talking about 1 tab in the front end of QlikView you cannot refresh it as the entire model is driven by the underlying data and data structure.
You can set up partial reloads that will reload only certain tables of in that data.
One request per tab is not ideal, recommended practice is that separate data is held in separate Qlikview documents.
However, this can be achieved - using variables and locally stored QVD's and the script below. You can also control variable values on the UI using buttons and actions on objects. The QVD's hold the data and are only reloaded when expressly requested.
//choose which data to load 1 = load query from scratch
Let vLoadQuery1=1;
Let vLoadQuery2=0;
Let vLoadQuery3=0;
Let vLoadQuery4=0;
Let vLoadQuery5=0;
if vLoadQuery1=1 then
//Enter load details and capture in local QVD
//Load
Query1:
LOAD *;
SQL select * from some.data;
//Store
STORE * from Query1 into Query1.qvd (qvd);
Drop Table Query1;
ENDIF
//Load from QVD - if this hasn't been loaded on this reload, it will grab the previous data
NewQuery1:
LOAD *
FROM Query1.qvd (qvd);

Qlik View: Retrive Last Reload of another report

In a qlik report(Main Report) i have a text object with an action that open another report. Is there the possibility to show in the text object located in the Main Report the last Reloadtime date of the report that i open with the action ?
thank's
while reloading the other report,
use:
T1:
Load reloadtime() as reloadTime autogenerate(1);
store T1 into T1.qvd;
in the Main report file:
Load * from T1.qvd (qvd);
you can also use *add* Load * from T1.qvd (qvd); if you want to use partial reload.
thats it :)
i can use filetime() function but the last change is not necessarily the date of the last reloadtime().
I could store these information externally in a txt-file which you read in your target-application as include-variable. This will require a reload from the target. As alternatively could these value be stored in a database and read then per direct discovery without a reload.
A further option could be to transfer these information per selections by opening: AJAX and URL parameters maybe by selection a loosen dummy-date-table and these selection will then be queried per getfieldselections().

Data not updated in dhtmlx .net scheduler

I have problems and questions about this scheduler. I already tried to build and almost finished it. Although, I receive some errors...
What I do?
I create custom lightbox
mapping all the data in to table dbo.bEvent
I used custom eventbox like this : Scheduler.Templates.event_text = "({position_desc})" + " " + "{newrate}"
position_desc is actually from other table 'dbo.zone'
I create Views in SQL Server to retrieve data from 'newrate'. 'newrate' actually is a new attribute after I do some query to change rate "1000 to 1k" which is new rate save '1k'.
the views that I create by joining table "dbo.zone and dbo.bEvent"
Problem is?
when I save a new data or insert or update new data. my event box just give me '(Undefine)undefine'
all the data that i put in lightbox is save in dbo.bEvent
after I resfresh the page using f5 or navigate to next page or previous page then the data is updated.
Here i attach some screenshot. Thanks in advance
http://s1319.photobucket.com/user/matpyam/library/?sort=3&page=1
If you save the changes as described here http://scheduler-net.com/docs/lightbox.html#define_crud_logic ,
note that the method uses SchedulerFormResponseScript class to render the response.
Constructor takes instance of the event class to be returned to the client. Values of that event will be applied to the related event on the client-side
return (new SchedulerFormResponseScript(action, changedEvent));
make sure object that you send (changedEvent) has all data properties initialized. Basically the event should have the same data as when it is loaded from the Data action.
Alternative solution, which may be more straightforward, would be reload calendar data with the client-side api after saving event:
scheduler.clearAll();
scheduler.load("dataUrl", "json");
http://docs.dhtmlx.com/scheduler/api__scheduler_clearall.html
http://docs.dhtmlx.com/scheduler/api__scheduler_load.html