Easyui DataGrid Custom Editor and determine the return of various HTML controls based on the actual situation (custom options)

Source: Internet
Author: User

all columns are edited when added, and some columns do not become edit state when editing , the workaround1Custom Editor$.extend ($.fn.datagrid.defaults.editors, {uploadfile: {//UploadFile is the name of the editor you want to customizeInit:function(container, options) {///// Pass parameters via options            varStatus = $ ("#hidMode"). Val (); if(Status = = ' edit ') {                varInput = $ ("<a href= ' # ' style= ' cursor:pointer; ' value= '" + Options.url + "' onclick= ' Showfile (this.value) ' ></a& gt; "). AppendTo (container); }            Else {                varInput = $ ("<input type= ' file ' id= ' uploadfile ' name= ' UploadFile '/>"). AppendTo (container); }            returninput; }, GetValue:function(target) {return$ (target). Val (); }, SetValue:function(target, value) {varStatus = $ ("#hidMode"). Val (); if(Status = = ' edit ') {$ (target). Val ($ (target). Val ()+value);            $ (target). text (value); }            Else{$ (target). val (value); }}, resize:function(target, width) {varinput =$ (target); if($.boxmodel = =true) {input.width (80); } Else{input.width (width); }}});d Atagrid use the custom Editors{field:' File name ', Title: ' File Name ', Width:getwidth (0.1), align: ' Left ', sortable:true, Editor: {type:' UploadFile ', Options: {status:", url: '/uploadfiles/materialfile/'}         }}//value cannot be used inside/options, the transferred parameter is text

Easyui DataGrid Custom Editor and determine the return of various HTML controls based on the actual situation (custom options)

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.