AnsweredAssumed Answered

with programmatically element of javascript

Question asked by yousofothmanmakkawy on Mar 8, 2015
Latest reply on Mar 12, 2015 by yousofothmanmakkawy

hi

every body

i want example that add shape file to the map

but all element on page must be created programmatically with dojo

i try this:

 _addShapeFile: function (tool, toolbar, panelClass) {






            var ShapeFileDiv = toolbar.createTool(tool, panelClass);
            domStyle.set(ShapeFileDiv, {
                "height": "100%",
                "width": "100%"
            });
            //var newDiv1 = document.createElement("div");


            //document.getElementById("newDiv1").appendChild(ShapeFileDiv);
            ////newDiv1.appendChild(ShapeFileDiv);
            var file = document.createElement("INPUT");
            file.setAttribute("type", "file");


            var uploadForm = dojo.place("<form> Add shapefile as .zip file </form>", ShapeFileDiv);


            domConstruct.place(file, uploadForm);


            var ShapeFilebutton = domConstruct.create("button", {
                innerHTML: "Add FIle ",
                className: "button",
                type: "button",
                style: { color: "red" }
            }, domConstruct.create("div", {
                "class": "button11"
            }));

this code create button and upload file on form but i could not add the uploaded file to the map

any help please

Outcomes