Using Easyui to load the data returned by the server is often used for $ (' #fm '). Form (' Load ', row); Implementation, both convenient and concise, however, when the form contains Filebox, the code will be error, after tracking discovery, because Easyui tried to hide the file tag <input type= "Files" > assigned value, resulting in an error. Its source code is as follows:
Initvalue:function (JQ, _4d9) {return Jq.each (function () {var _4da = $.data (This, "TextBox"); _4da.options.value = ""; $ (th IS). TextBox ("SetText", _4d9), _4da.textbox.find (". Textbox-value"). Val (_4D9); $ (this). Val (_4d9);});},
Error by _4da.textbox.find (". Textbox-value"). Val (_4d9); As a result of this, therefore know prajna needs to rewrite it so that it can skip the assignment as it processes the file label. The modified code is as follows:
Initvalue:function (JQ, _4d9) { return Jq.each (function () { var _4da = $.data (This, "TextBox"); _4da.options.value = ""; $ (this). TextBox ("SetText", _4d9); var obj = _4da.textbox.find (". Textbox-value"); if (obj.attr ("type")! = "File") { obj.val (_4D9); } $ (this). Val (_4d9); });
Of course, if you just show the data after the load, then there is no problem, if you can submit again, do update operation, then you have to be careful, because at this time, although the page shows the file server path, but, The file tag that is actually submitted to the server does not actually point to any local files, so the file submitted is empty.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Fixed data load error when Filebox is present in Bug--form of Easyui