Skip to content

Instantly share code, notes, and snippets.

@theredpea
Created February 7, 2018 20:21
Show Gist options
  • Select an option

  • Save theredpea/2607e4653b0a4fc547508ea65fe61e57 to your computer and use it in GitHub Desktop.

Select an option

Save theredpea/2607e4653b0a4fc547508ea65fe61e57 to your computer and use it in GitHub Desktop.
app.getObject(nate_non_published_config.object_ids.get_scatter_html_id(), nate_non_published_config.object_ids.get_scatter_qlik_id());
//Locking all hopefully sometime after object comes back and asks for layout
//Delibierately causing a request aborted error by waiting for getObject to call getLayout,
//the getObject should return the handle quickly, the sbusequent getLayout will take awhile because the scatterplot is memory-intensive to render
//so when the app.field(...).select(...) happens *after* the GetLayout is sent, but *before* it can return...
//then:
//
// qlik.js:11047 Error from Engine:
// {jsonrpc: "2.0", id: 9, error: {…}}
// error
// :
// {code: 15, parameter: "Failure", message: "Request aborted"}
// id
// :
// 9
// jsonrpc
// :
// "2.0"
//this is by design:
//*Despite the error* (because of the error), another GetLayout is sent
//the result is not interrupted with a new command;
//the resulting scatter plot correctly renders *considering the selection*
//the scatter plot only shows 3 dots; those 3 which were selected!
//(if the previous hadn't aborted, user may have seen a fully-populated (1M) scatter plot even after selecting just 3 of its values, which is confusing)
$timeout(function() {
// app.lockAll();
app.field('ID').select([0,1,2])
}, 200);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment