We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Add other component on popup dialog

Thread ID:





146196 Jul 25,2019 01:21 AM UTC Jul 26,2019 02:52 AM UTC JavaScript - EJ 2 1
Tags: Dialog
Peng Xie
Asked On July 25, 2019 01:21 AM UTC

I have a grid of items, each of item contains a button when it is clicked popping a dialog. In the dialog I want to have a file uploader component from syncfusion. I tried this way, but didn't work well.

Browser Error:

I do have attached dialog to html element.

Narayanasamy Panneer Selvam [Syncfusion]
Replied On July 26, 2019 02:52 AM UTC

Hi Peng, 
We have analyzed shared code blocks and suspect that target element and appendTo method not at all used to render a EJ2 components in your sample, so that you may got the reported console error. 
For your convenience we have prepared stackblitz sample with your shared code block. Please find it in the following link: https://stackblitz.com/edit/ixcixu-52reuf?file=index.js 
Also find detailed information of some important code block used in the sample, 
1. Define target elements in html page 
<div id="dialog"> 
    <input type="file" id="upload" name="UploadFiles"/> 
2. Render uploader and dialog in given order

var dialog = new ej.popups.Dialog({ 
  header: 'Uploader', 
  showCloseIcon: true, 
  visible: false, 
  target: "#target" 
dialog.appendTo('#dialog'); // Initialize Dialog component 
var uploader = new ej.inputs.Uploader({ autoUpload: false }); 
uploader.appendTo('#upload'); // Initialize Uploader component 
3. Call dialog show method in grid button click event. 
function onClick() { 
Note: Do not place component creation in button click handler, because each button click component reinitialized and duplicate element append in DOM. 
Narayanasamy P.  


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon