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)