JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › button column with smart-window
- This topic has 1 reply, 2 voices, and was last updated 3 years, 7 months ago by
yavordashew.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
February 1, 2021 at 5:52 am #101412
dusrkdldlr
Memberhello! 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>
February 1, 2021 at 9:48 am #101415yavordashew
MemberHi 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/ -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.