• Resolved marcfragstein

    (@marcfragstein)


    “Tablesome pro” user here – i want to change the entries of a table (which i actually hide from the user) via JQuery. I fetch the values from other textfields, inputs etc and put them in an array. For now, i am using a super hacky way of focusing the table cell via Jquery (focus(), blur(), etc.), then simulating an user Input and selecting the next cell. Of course, this is a bit slow and unreliable. I already heard from another user in this forum about a similiar request, which you replied to privately. Can you help me out? Basically, in the end, i just want to push string values from an array to the tabelcells via .val().

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Essekia

    (@essekia)

    @marcfragstein I don’t remember the other request. Can you share the link to that?

    Thread Starter marcfragstein

    (@marcfragstein)

    Thread Starter marcfragstein

    (@marcfragstein)

    Hey my friend, any news on this?

    Plugin Author Essekia

    (@essekia)

    Can you share your current code, so I can try to find a way to check and implement that?

    Regards.

    Thread Starter marcfragstein

    (@marcfragstein)

    I do something like :

    console.log(“ANFRAGE SENDEN”);
    var field_selector = “anfrage_closed”;
    $(‘.tablesome__tbody tr td.tablesome__cell–text’).trigger(‘blur’);
    $(‘.tablesome__tbody input’).trigger(‘blur’);
    $(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().trigger(‘focus’); $(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().trigger(‘click’);
    $(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().find(“input”).trigger(‘focus’); $(“.tablesome__tbody td.tablesome__cell–text[data-label='” + field_selector+”‘]”).first().find(“input”).trigger(‘click’);
    await sleep_anfrage(1);
    var focused_field = $(“.tablesome__tbody tr td.tablesome__cell–text.tablesome__cell–edit”);
    console.log(“focused_field” + focused_field.html())

            var focused_input = focused_field.find("input");
            console.log("focused_input.html()" + focused_input.html())
                    if(focused_input.length) {
        console.log("FOUND A TEXT FIELD");
                        const textField = focused_input.get(0);
    
    
        textField.value = "yes";

    // Fire a change event on the text field
    textField.dispatchEvent(new Event(‘change’));
    const simulatedInputEvent = new InputEvent(‘input’, {
    data: ‘This is simulated user input’, // Text to be inserted
    inputType: ‘insertText’ // Simulates typing new characters
    });

    // Dispatch the simulated input event on the text field
    textField.dispatchEvent(simulatedInputEvent);



    }
    So i have to blur fields, focus fields, simulate user inputs. Just putting in the .val() doesnt work. Is there a way to change that?
    Plugin Author Essekia

    (@essekia)

    @marcfragstein Ok. Will take this into consideration. Unfortunately, at this point in time, there are a lot of other priorities at our end. Regards.

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