Solutions to conflicts between DWZ and ASP. net mvc frameworks, dwzmvc
A recent project used the integrated development of dwz and mvc. However, The lookup function in dwz has kidnapped the name tag, which makes it difficult to transmit values to the background, now we have set a separate bringbackname attribute for the tag for association.
Dwz. min. js
Rows 1 and 2714 change the attributes that are returned. The attributes that are originally returned are changed to the name attribute.
var $input=$(this),inputName=$input.attr("bringbackname");
Rows 2 and 2861 add properties for th
bringbackname: $th.attr("bringbackname") || "",
3. Row 3: Change the replaceSuffix rule and add a replacement rule as the bringbackname attribute.
bname = $this.attr('bringbackname');if (bname) $this.attr('bringbackname', bname.replaceSuffix(i));
4. In row 3, change the generated th tag attribute, and set the html rule to lookup.
SuggestFrag = 'autocomplete = "off" lookupGroup = "'+ field. lookupGroup + '"' + suffixFrag + 'suggesturl =" '+ field. suggestUrl + '"suggestFields ="' + field. suggestFields + '"' + 'postfield =" '+ field. postField + '"';} html = '<input type =" hidden "name ="' + field. lookupGroup + '. '+ field. lookupPk + suffix + '"/>' + '<input type =" text "name ="' + field. name + '"' + 'bringbackname =" '+ field. bringbackname + '"' + suggestFrag + 'lookuppk =" '+ field. lookupPk + '"size ="' + field. size + '"class ="' + field. fieldClass + '"/>' + '<a class =" btnLook "href ="' + field. lookupUrl + '"lookupGroup ="' + field. lookupGroup + '"' + suggestFrag + 'lookuppk =" '+ field. lookupPk + '"title =" "> </a> ';