最近在用dwz的查找找回功功能的时候,直接写在页面上的标签都是正常的,如:
<a class="btnLook" href="${base}/lb/imageStore_suggestList" lookupgroup="topicContents[0]" title="选择图片">选择图片</a>
但是通过js 动态生成的表总是有问题,最后才发现需要手动绑定下lookup 方法如:
var topicIndex = 1;
function addTopic(btn){
var html = '<tr>';
html += '<td>'+topicIndex + '</td>';
html += '<td><input type="hidden" name="topicContents['+(topicIndex-1)+'].coverId">';
html += '<img name="topicContents['+(topicIndex-1)+'].cover" width="120" height="90">';
html += '<a class="btnLook" rel="pageTopic'+topicIndex+'" target="dialog" href="${base}/lb/imageStore_suggestList" lookupgroup="topicContents['+(topicIndex-1)+']" title="选择图片">选择图片</a>';
html += '</td>';
html += '<td><input type="text" class="textInput" name="topicContents['+(topicIndex-1)+'].title"></td>';
html += '<td><input type="text" class="textInput" name="topicContents['+(topicIndex-1)+'].type"></td>';
html += '<td><a class="btnLook" href="${base}/lb/article_suggestList" lookupgroup="topicContents['+(topicIndex-1)+']" title="选择文章">选择文章</a></td>';
html += '</tr>';
$("#contentTbody"+topicIndex).append(html);
debugger;
<span style="color:#ff6666;"> $("#contentTbody").find(".btnLook").each(function(){
$(this).lookup();
});</span>