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.
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"/>
</div> |
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() {
dialog.show();
} |
Note: Do not place component creation in button click handler, because each button click component reinitialized and duplicate element append in DOM.
Regards,
Narayanasamy P.