JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › Reload page
- This topic has 1 reply, 1 voice, and was last updated 1 month ago by Oleg Ilin.
-
AuthorPosts
-
October 21, 2024 at 10:35 am #111614Oleg IlinParticipant
Dear friends!
I am using components in the domino xpage framework. Unfortunately, the grid with the v Virtual Mode function of our Tree Grid mode behaves incorrectly. In other words, the initial part of the adapter is loaded
virtualDataSource: function (resultCallbackFunction, details) {
// setTimeout(function()
//{
var that = this;
if (details.action === ‘dataBind’) {
fetch(‘https://demo.realsoft.kz/rest/Rest.nsf/struct.xsp/view-definitions?expandlevel=0’).then(
response => response.json()) …. etc
and everything happens correctly,
However, loading the loaded virtual partvirtualDataSourceOnExpand: function (resultCallbackFunction, details) {
setTimeout(function()
{
var countnode=details.row.level+1;
// const countnode=details.row.data[‘@position’]+”.1″
var nodeid=details.row[‘@unid’];var b= “/struct.xsp/view-definitions?expandlevel=”+countnode +”\u0026parentid=”+nodeid;
var url=’https://demo.realsoft.kz/rest/Rest.nsf’+b;
fetch(url).then(
response => response.json())…………………………..
leads to a page reload.
Can you tell what causes the reload and what are the solutions?
It seems that fecth does not have time to work and the grid starts loading and transforming with incorrect data.
I pasted your example from the reference
webcomponents-demos/grid/virtual-tree-grid/index.htm
and surprisingly it worked in the framework that I used with a delay in the functions
setTimeout(function(){ ……….}),0)
with 0 milliseconds for both of the parts of an adapter .Any positive value caused a page reload/Can you tell me about it?
Thank you/
October 21, 2024 at 5:06 pm #111617Oleg IlinParticipantDear friends.
The request is cancelled. I found a very compact technique (it will work for any framework), which removes all handlers when pressing the category expansion button, except for the native smart web component. As stated in the request, third-party frameworks and environment programs can use their own handlers for button presses, mouse behavior, etc. Smart web components are configured to work with DOM and use aria technology and internal variables in DOM.
The given technique removes all handlers (in particular on the button), leaving only the native handler.
(JQuery was used, but any listener will do)……
function disableTabindexButtons() {
var buttons = document.querySelectorAll(‘smart-grid-row’)
buttons.forEach(function(note) {
var note1 = note.querySelector(“button”)
note1.setAttribute(“type”,”button”);
});
}$(document).ready(function() {
$(document).mouseup(function (e) {
var t= e.target.getAttribute(“tabindex”)
if (t==”-1″){
e.preventDefault(); // if it needs you can find smart-grid-sell-container in the parent
e.stopPropagation();
disableTabindexButtons() }
})
})Thanks
-
AuthorPosts
- You must be logged in to reply to this topic.