1
我有一個模板,如下如何調用jQuery的模板函數返回值
<script id="ActionTemplate" type="text/x-jquery-tmpl">
<tr>
<td> <a href="#" OnClick="setActionId(${action_id}, ${project_id}, ${merchant_id}, ${channel_id}, ${customer_id})" >${action_id}</a></td>
<td>${priority} </td>
<td>${date_to_display} </td>
<td> ${date_from}</td>
<td>${action_title} </td>
<td> ${status()} (${percentage_completed}%)</td>
<td> ${hours}</td>
<td>${contactFrom} </td>
<td>${contactTo} </td>
</tr>
</script>
以上
${status()}
調用函數狀態返回這樣
<script type="language/javascript">
function status(){
return "some_string";
}
</script>
我的問題是我的字符串hav從狀態函數被調用的模板發送一個值... .. like值...
所有在模板中的值,如${priority}
,${hours}
等被綁定到一個PageMethod的模板......
需要一個解決方案
yes action_status is right ..im tryin what you hav says – bhargav 2011-05-24 14:08:32
thanx shane that really works ..i hav has been serching for this since 4 hr ..im jus started with templates – bhargav 2011-05-24 14:13:52
沒問題...模板很棒,不是嗎?只需保持該API的鏈接方便...;) – ShaneBlake 2011-05-24 14:15:16