
Invoke window.open to open the details page, table records are rendered slowly.
Invoke window.open to open the details page, table records are rendered slowly. Referred code:
(function() {
"use strict";
kintone.events.on('app.record.index.show', function(event) {
var myIndexButton = document.createElement('button');
myIndexButton.id = 'my_index_button';
myIndexButton.innerText = 'Open Window';
kintone.app.getHeaderMenuSpaceElement().appendChild(myIndexButton);
myIndexButton.addEventListener("click", function(event){
if(event.ctrlKey){
window.open("https://{subdomain}.cybozu.com/k/9334/show#record=5&l.view=20&l.q&l.next=4&l.prev=6","_blank");
}
});
});
})();
The bug occurs in Chrome: 85.0.4183.26 and Microsoft Edge 84.0.522.40
7 comments
Hello Linner,
Could you kindly check the details of the events that are occurring?
・What exactly is the situation with the rendering slowly?
(e.g., it takes about 10 seconds to display a table.)
・How much information is entered into the table where the event occurs?
・The records being displayed have no JS processing in them.
Thanks,
Sean
Sean,
Compare to open details page by click the icon "Show the record details" in row header, it is much slower to invoke the script to open details page.
window.open("https://{subdomain}.cybozu.com/k/9334/show#record=5&l.view=20&l.q&l.next=4&l.prev=6","_blank");
If a table has 3 items, to open it by click icon, the table shows immediately when the details page shows. But if you invoke the code, you will find the 3 items show one by one, it takes about 4 seconds to show the 3 items.
You please attach the scritps I post in any app that has table, then use Ctrl+click to click the button, you can reproduce the bug.
Hey Linner,
The following code worked fine on my end:
Hello John,
>May I ask why you have set the `window.open(...)` code to only work when the CTR button is pressed?
Out business logic need to hold ctrl then left click on the button.
With the code you pasted, the bug won't occur, you are right. But if you hold ctrl key to click on the button, you can reproduce the bug.
>perhaps the query you are running to generate the record specific URLs is the culprit?
No matter you hold ctrl or not, the queries are same.
>I was unable to click the button itself since the CTR button triggers a Left Click for me.
What do your mean? Could you please provide us a solution to solve the problem?
Hello Linner,
Sean,
Thanks for your help. We will try to use other function.
>I'm not quite sure why it is necessary to press ctrl to process it, could you process without pressing it?
Holding down ctrl will open the url in new tab page.
Thanks,
Linner