The app will not delete images after uploading pictures.

Source: Internet
Author: User

I believe in the micro-development of the brothers know, micro-engine in the manual is still a bit of a pit, do not let people live ah. No way, development, you can only look at the source to engage in >>>>

OK, not much to say. Now look at a pit. directly on the code \

Html:

<!--own Head Introduction--
{Template ' Common_header '}<Scripttype= "Text/javascript"src= "{$_w[' siteroot ']}app/resource/js/app/util.js"></Script><Scriptsrc= "{$_w[' siteroot ']}app/resource/js/require.js"></Script><Scripttype= "Text/javascript"src= "{$_w[' siteroot ']}app/resource/js/lib/mui.min.js"></Script><Linkhref= "{$_w[' siteroot ']}app/resource/css/common.min.css"rel= "stylesheet"><Scripttype= "Text/javascript"src= "{$_w[' siteroot ']}app/resource/js/app/common.js"></Script><formAction=""Method= "POST"> <ulclass= "Report-list white clearfix"> <Liclass= "Clearfix"> <Divclass= "Pull-left">title</Div> <Divclass= "Pull-right"> <inputtype= "text"placeholder= "Please enter title"name= "Report_title"value=""> </Div> </Li> <Liclass= "Clearfix"> <Divclass= "Pull-left">Fill in person</Div> <Divclass= "Pull-right"> <inputtype= "text"placeholder= "Please enter the person to fill in"name= "Report_author"value=""> </Div> </Li> </ul> <Buttontype= "button"class= "Submit-report">Submit</Button> <inputtype= "hidden"name= "token"value= "{$_w[' token ']}" /></form><Scripttype= "Text/javascript"> $(function() {mui.init ({swipeback:true //enable the right slide off feature }); //Upload ImageUtil.image ($ ('. Js-image-report_picture'), function(URL) {$ ('. Js-image-report_picture'). Parent (). Find ('. Js-image-preview'). Append ('<input type= "hidden" value= "'+url.attachment+'"Name=" report_picture[] "/>'+Url.url+'"Data-id="'+url.id+'"data-preview-src=" "data-preview-group=" __img_upload_report_picture "/>'); }, {crop:false,//croppingMultiple:true,//Multi-Imagepreview:'__img_upload_{$name}'//Preview }); });</Script>{template ' Common_footer '}

Page Map:

After uploading and then clicking the Delete image, the force of your primitive is futile:

Later read the source, he this is the MUI encapsulated Webuploader come over. The most straightforward and straightforward way to do this is to re-write the deletion method on the page:

// Delete a picture        function (a) {            var b = $ (document). Find (". Mui-slider-group. Mui-active"). index ();            $ (". Mui-image-preview input"). EQ (b). Remove ();            $ (". Mui-image-preview img"). EQ (b). Remove ();             var i = mui.previewimage ({footer:util.templates["image.preview.html"});            I.close ();        });

This can be achieved by::

Finally attach the preparatory thought of the plenary: practice is the only standard to test truth

You can't delete pictures after uploading pictures from the app side

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.