Get/Change value of widget controls dynamically in Elementor

Viewed 276

I am developing a plugin for the elementor editor , and I am stuck with this problem that I need help resolving, I need to get the Values of the controls on the side , like for example getting the value of “Info” control (custom contorl that i have made) , by clicking the “Generate Button “ , How to connect the “GenerateEvent” the Generate Button in the right scope to get the values from the widget panel.

My widget plugin looks like this :

Plugin Widget

Trying to attach an hook on Generate Event with code, and trying to take the Order info to a defiend variable like this :

jQuery( window ).on( 'elementor/frontend/init', () => {
    elementor.channels.editor.on('GenerateEvent', () => {
        let info = window.jQuery("[data-setting='Info']").val();
        console.log( Info );
        let tash = window.jQuery("[data-setting='tash']")[0].value;
        console.log(info);
        let tashType = jQuery("[data-setting='tashType']")[0].value;
        let FixTash = jQuery("[data-setting='tashType']")[0].value;
        let sendemail = jQuery("[data-setting='sendemail']")[0].value;
        let PageLang = jQuery("[data-setting='PageLang']")[0].value;
        let Coin = jQuery("[data-setting='Coin']")[0].value;
        let Postpone = jQuery("[data-setting='Postpone']")[0].value;
        let J5 = jQuery("[data-setting='J5']")[0].value;


});

});

But the problem its not defiend on the same scope … and i get this error , also when i write the command in the console i actually getting the info (because the scope is the right scope)

What is the right scope to access variables in my code or in other words what is the code that i need to wrote or some hook that i need to attach , so i can retrieve the Info from the elementor widget editor ?

Console

0 Answers
Related