Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #111614
    Oleg Ilin
    Participant

    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 part

    virtualDataSourceOnExpand: 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/

    #111617
    Oleg Ilin
    Participant

    Dear 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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.