jtemplate

jQuery Autocomplete & jTemplates - handling response

风格不统一 提交于 2019-12-25 14:25:47
问题 Has anyone had any experience with using jTemplates to display autocomplete results. I have the following $("#address-search").autocomplete({ source: "/Address/SearchAddress", minLength: 2, delay: 400, focus: function (event, ui) { $('#address-search').val(ui.item.name); return false; }, parse: function(data) { $("#autocomplete-results").setTemplate($("#templateHolder").html()); $("#autocomplete-results").processTemplate(data); }, select: function (event, ui) { $('#address-search').val(ui

jTemplates: html in variables

烈酒焚心 提交于 2019-12-23 15:42:43
问题 I'd like to include some html in a jTemplate variable - e.g. <td class="numeric">{$T.total_price}</td> Where total_price is: "$12<span>.00</span>" Is there any way I can get the span to show up as html? 回答1: I got it with: $('#mhid')setTemplate(s, [], {filter_data: false}); 回答2: I am having the same problem: Template: <textarea id="pagination" style="display:none"><b>pagination</b></textarea> If I call the template as: $('').setTemplate($('pagination').html(),[],{filter_data: false}); $('')

How do I prevent scrolling to the top of a page when popping up a jQuery UI Dialog?

橙三吉。 提交于 2019-12-18 03:04:32
问题 I currently use jTemplates to create a rather large table on the client, each row has a button that will open a jQuery UI dialog. However, when I scroll down the page and click on one of those buttons, jQuery dialog will open, but the scroll position get lost and the page jumps back to the top (with the blocking and the actual dialog showing off the screen). Has anyone seen or know what might cause this problem? Thanks. 回答1: Are you using an anchor tag to implement the "button" that pops the

jTemplates escape {$

馋奶兔 提交于 2019-12-12 12:34:36
问题 is there a way with jTemplates to escape {$, so i can use inline javascript in my onBlur like <a href="http://www.telegraaf.nl" onclick="if ( a ) {$('#something').css ('display','none');alert('some msg');}">telegraaf</a> which gets this after processTemplate: <a onclick="if ( a ) " href="http://www.telegraaf.nl"> Thanks, Henk 回答1: jTemplates has a {#literal} ... {#/literal} tag that should prevent your curly braces from being affected. <a href="http://www.telegraaf.nl" onclick="{#literal}if (

How do I prevent scrolling to the top of a page when popping up a jQuery UI Dialog?

馋奶兔 提交于 2019-11-30 08:09:31
I currently use jTemplates to create a rather large table on the client, each row has a button that will open a jQuery UI dialog. However, when I scroll down the page and click on one of those buttons, jQuery dialog will open, but the scroll position get lost and the page jumps back to the top (with the blocking and the actual dialog showing off the screen). Has anyone seen or know what might cause this problem? Thanks. Are you using an anchor tag to implement the "button" that pops the dialog? If so, you'll want the click handler that opens the dialog to return false so that the default