我目前使用jTemplates在客户端上创建一个相当大的表,每一行都有一个按钮,它将打开一个jQuery UI对话框.但是,当我向下滚动页面并单击其中一个按钮时,jQuery对话框将打开,但滚动位置会丢失,页面会跳回到顶部(阻止和实际对话框显示在屏幕上).有谁见过或知道可能导致这个问题的原因?
谢谢.
我想在jTemplate变量中包含一些html - 例如
<td class="numeric">{$T.total_price}</td>
Run Code Online (Sandbox Code Playgroud)
其中total_price是:
"$12<span>.00</span>"
Run Code Online (Sandbox Code Playgroud)
有什么方法可以让我的跨度显示为HTML?
有没有办法让jTemplates逃脱{$,所以我可以在我的onBlur中使用内联javascript
<a href="http://www.telegraaf.nl" onclick="if ( a ) {$('#something').css ('display','none');alert('some msg');}">telegraaf</a>
Run Code Online (Sandbox Code Playgroud)
在processTemplate之后得到这个:
<a onclick="if ( a ) " href="http://www.telegraaf.nl">
Run Code Online (Sandbox Code Playgroud)
谢谢,亨克
我有一个从MVC页面返回的以下JSON日期,例如
"DateProcessed":"\/Date(1258125238090)\/"
Run Code Online (Sandbox Code Playgroud)
我正在使用JTemplates处理数据,如下所示.
$('#result').setTemplate($("#TemplateResultsTable").html());
$("#result").processTemplate(data);
Run Code Online (Sandbox Code Playgroud)
这是我的结果模板
<script type="text/html" id="TemplateResultsTable">
<h3>{$T[0].StatusName} - Found: {$T.length} </h3>
<table>
<tr>
<th>Name</th>
<th>Description</th>
<th>Date Processed</th>
</tr>
{#foreach $T as match}
<tr>
<td>{$T.match.Title}</td>
<td>{$T.match.Description}</td>
<td>{$T.match.DateProcessed}</td>
</tr>
{#/for}
</table>
</script>
Run Code Online (Sandbox Code Playgroud)
除了我的日期在页面上输出为/ Date(1258125238090)/之外,一切都很棒
如何格式化结果模板中的日期?