is showing a list table, and the data in the table comes from a list, and the fields in the entity class in the list are taken from the dictionary table Therefore, values such as 0 and 1 are stored. Since text needs to be displayed during display, I wrote a comparison method
[html] view plain copy var len='${fn:length(products.detailList)}'; for(var index=0;index<len;index++){ var singleunit='${products.detailList[""+index+""].supply.singleunit}'; for(var u=0;u<dictlist.length;u++){ var value=dictlist[u].value; var label=dictlist[u].label; if(singleunit==value){ $("#specunit"+index+"").html(label); } } }
Haha, pay attention to the double quotes there. I struggled for several hours and even thought of changing my mind. Later, I thought of jquery connecting variables, and I was instantly inspired, and the result was great.
The above is a list of js and el expression operations that I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
Detailed introduction to the use of EL expressions in JS
How to pass two parameters to JS onclick Specific steps of JS method
Detailed explanation of JS rewriting prototype object
The above is the detailed content of Focus on analyzing and answering js and el expression operation list. For more information, please follow other related articles on the PHP Chinese website!