Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #101412
    dusrkdldlr
    Member

    hello! I use vue.
    I  want the smart-window popup to open when I click the columns button.
    this is my code,

    
    <div>
    <div>{label: jQuery.i18n.prop("test"), dataField: 'test', width: 200, align: 'center'</div>
    <div>                              , template: function(formatObject){</div>
    <div>                                  if (!formatObject.template){</div>
    <div>                                    const button = document.createElement("smart-button");</div>
    <div>                                    button.innerHTML = formatObject.value;</div>
    <div>                                    button.row = formatObject.row;</div>
    <div>                                    console.log("button row?", button.row)</div>
    <div>                                    var dialogWindow = document.createElement("smart-window");</div>
    <div>                                    dialogWindow.id="dialogwindow"</div>
    <div>                                    //dialogWindow.innerHTML = <code><div>hello</code> + formatObject.value + <code></div></code>;</div>
    <div></div>
    <div>                                    dialogWindow.addEventListener("open", function(event) {</div>
    <div>                                      console.log("open!")</div>
    <div>                                    });</div>
    <div>                                    button.addEventListener("click", function() {</div>
    <div>                                      console.log('Button inside the column was clicked')</div>
    <div>                                      dialogwindow.open();</div>
    <div>                                      //smartwindow.open()</div>
    <div>                                    });</div>
    </div>
    

    and this error was returned.
     

    
    Uncaught TypeError: dialogwindow.open is not a function
    at HTMLElement.<anonymous>
    
    #101415
    yavordashew
    Member

    Hi dusrkdldlr,
    The problme here in your case is quite simple.First you define ‘dialogWindow’ with capital ‘W’ but in the event listener of the button you use it with lowercase ‘w’ just change your code to this”

    
     button.addEventListener("click", function() {
                console.log('Button inside the column was clicked')
                dialogWindow.open();
                //smartwindow.open()</div>
                                       });
    

    Please, do not hesitate to contact us if you have any additional questions.
    Best regards,
    Yavor Dashev
    Smart UI Team
    https://www.htmlelements.com/

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