Search Results

Search found 11 results on 1 pages for 'jtemplate'.

Page 1/1 | 1 

  • One object in jTemplate?

    - by Dejan.S
    Hi I'm using jTemplate for the first time. I been reading and it's not that hard to use it BUT what I can not figure out and find any thing on is how to work with one object, all the examples I find are a list of objects. My situation is I need to work with one object only. How can I do that? I mean How to work with the data in the jTemplate like this example but one only. <script type="text/html" id="TemplateResultsTable"> {#template MAIN} <table cellpadding="10" cellspacing="0"> <tr> <th>Artist</th> <th>Company</th> <th>Title</th> <th>Price</th> </tr> {#foreach $T.d as CD} {#include ROW root=$T.CD} {#/for} </table> {#/template MAIN} {#template ROW} <tr class="{#cycle values=['','evenRow']}"> <td>{$T.Artist}</td> <td>{$T.Company}</td> <td>{$T.Title}</td> <td>{$T.Price}</td> </tr> {#/template ROW} </script>

    Read the article

  • How to access Javascript variable inside Jtemplate?

    - by user330547
    function(result) { var lParsedResult = result.d; var userTyp = "test"; //getting this value from some other source $("#accountList").setTemplate($("#accountListTemplate").html()); $("#accountList").processTemplate(lParsedResult); } <div id="accountList"> <script type="text/html" id="accountListTemplate" > {#foreach $T as account} <div {#if userTyp == "test"} style="display: inline" {#else} style="display: none" {#/if}> <p>othere info</p> </div> {#/for} </div> I want to hide a block if the user type = "test". appreciate your help Thanks, Mathew.

    Read the article

  • Working with jTempalte and objects

    - by Dejan.S
    EDITSolved the one object question I had at first Hi I'm using jTemplate for the first time. I been reading and it's not that hard to use it BUT I just found a examaple on one object use. <script type="text/html" id="TemplateREsultTable"> <div style="background-color: #ccc">{$T.Email}</div> <div style="background-color: #ddd">{$T.Password}</div> </script> One question about jTempaltes I got is what is better to do them in htm file or script? Another thought I got, is jTemplate the way to go?

    Read the article

  • jQuery Autocomplete & jTemplates - handling response

    - by Diegos Grace
    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.item.name); $('#search-address-id').val(ui.item.id); $('#search-description').html(ui.item.address); }); and the simple jtemplate holder: <script type="text/html" id="templateHolder"> <ul class="autocomplete"> {#foreach $T as data} <li>{$T.name}</li> {#/for} </ul> </script> Above i'm using 'Parse' to format results, I've also tried the autocomplete result method but not having any luck so far. The only success I've had is by using the private method ._renderItem and formatting the data that way but we want to render the output using the jTemplate. Any advice appreciated.

    Read the article

  • HTML image display

    - by windi
    I have an html file where i am loading images from an xml file in to it. i am using jtemplate for that. I am getting the images properly.but i want to display them horizontaly those are coming as vertical. Please help me to do that,This is the sample.

    Read the article

  • Java Script JQUery

    - by windi
    Hi I am extracting data from an xml file converting it into json and rendering the images which i am retriving to the html file via jtemplate.now i want to user scroller and scroll the images .i can call to the scroller plugin but it is not scrolling throuhg . can any one help me please.

    Read the article

  • How to update a table row with save button using .ajax

    - by Randall
    I have a table which has one row and only one cell will be editable. I have accomplished this with the following code. $("td#effEndDate").click(function() { if (!$(this).hasClass("edit")) { var value = jQuery.trim($(this).html()); $(this).html("<input id=\"txtEdit\" type=\"text\" value=\"" + value + "\" />"); $(this).addClass("edit"); $("#txtEdit").focus(); } }); Now this is the part where i'm stuck. After the field is updated a save button must be clicked to call the proper .ajax method to update the database. But how can I compare the previous value to the current value on a button press? Since i'm not using the onblur property where I could have saved the old value and passed it to the update function.

    Read the article

  • How to reference a specific object in an array of objects using jTemplates

    - by Travis
    I am using the excellent jTemplates plugin to generate content. Given a data object like this... var data = { name: 'datatable', table: [ {id: 1, name: 'Anne'}, {id: 2, name: 'Amelie'}, {id: 3, name: 'Polly'}, {id: 4, name: 'Alice'}, {id: 5, name: 'Martha'} ] }; ..I'm wondering if it is possible to directly specify an object in an array of objects using $T. (I'm hoping there is something like $T.table:3 available) Currently the only way I can think of to access a specific object in an array is to do something like this... {#foreach $T.table as record} {#if $T.record$iteration == 3} This is record 3! Name: {$T.record.name} {#/if} {#/for} However that seems clumsy... Any suggestions? Thanks

    Read the article

  • jQuery tabs error when used with jTemplates

    - by tessa
    I am using jTemplates to format data returned from a json query. I am trying to transform the div with the id "fundingDialogTabs" into jQuery tabs after the template is processed. It renders the tab buttons, but both fragment1 and fragment2 divs are showing at the same time. I get the error "jQuery UI Tabs: Mismatching fragment identifier" when clicking on the fragment2 tab. I tested the jQuery tabs code outside of the template and it works fine. Here is the template (saved in .tpl file). {#template MAIN} <div style="width:500px"> <table border="0" cellpadding="0" cellspacing="0" id="fundingDialogTitle"> <tr> <td class="fundingDialogTitle">Funding Breakout</td> <td style="text-align:right"><img src="../../images/fscaClose.gif" onclick="CloseFundingDialog()" style="cursor:hand; width:25px; height:25px;"></td> </tr> </table> </div> <div style="padding:10px 10px 10px 10px; width:500px"> <div id="fundingDialogTabs"> <ul> <li><a href="#fragment1"><span>Source</span></a></li> <li><a href="#fragment2"><span>Line Item</span></a></li> </ul> <div id="fragment1"> <table border="0" cellpadding="0" cellspacing="0" id="fundingDialog"> <tr> <th>Funding Source</th> <th>Amount</th> </tr> {#foreach $T.d as fundingList} {#include ROW root=$T.fundingList} {#/for} </table> </div> <div id="fragment2"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </div> </div> </div> {#/template MAIN} {#template ROW} <tr> <td>{$T.SourceName}</td> <td>{$T.Amount}</td> </tr> {#/template ROW} Here are the json and processTemplate methods: function GetFundingDialog(id) { $.ajax({ type: "POST", url: "../../WebService/Workplan.asmx/GetFundingList", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { ApplyTemplate(msg, id); }, error: function(result) { ShowError(result.responseText); } }); } function ApplyTemplate(msg, id) { var fundingDialog = $("div[id='divFundingList']"); if (fundingDialog.length > 0) { fundingDialog.setTemplateURL('../../usercontrols/Workplan/FundingList.tpl'); fundingDialog.processTemplate(msg); fundingDialog[0].style.display = "block"; var src = $("img[id='openFundingList_"+id+"']"); if (src.length > 0) { var srcPosition = findPos(src[0]); fundingDialog[0].style.top = parseInt(srcPosition[1] + 25); } } $("#fundingDialogTabs").tabs(); }

    Read the article

  • [jQuery] JS inside the template

    - by Martin Trigaux
    Hello, I'm trying to include some javascript code inside a template. The code of my html page : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <script type="text/javascript" src="jquery-jtemplates.js"></script> </head> <body> <div id="infos"></div> <div id="my_template"></div> <script type="text/javascript"> $(document).ready(function() { $('#my_template').setTemplateURL("my_template.html"); try { $('#my_template').processTemplate({'var' : 1}); } catch (e) { $('#infos').html('error : '+e); } $('#my_button').click(function(){ alert('it works outside'); }); }); </script> </body> </html> and the template content of the template<br/> {#if $T.var == 1} <script type="text/javascript"> $(document).ready(function() { $('#my_button').click(function(){ alert('it works inside'); }); }); </script> <input type='submit' id='my_button' value='click me' onclick='alert("direct");'/> {#else} not working {#/if} produce me an error inside the infos balise error : SyntaxError: missing } after function body if I just put alert('it works inside'); inside the script balise (remove all the jquery related code), the page load, the two message "direct" and "it works outside" are showed but not "it works inside" message. It's suppose to works as said on the doc page Allow to use JavaScript code in templates Thank you

    Read the article

  • May 20th Links: ASP.NET MVC, ASP.NET, .NET 4, VS 2010, Silverlight

    - by ScottGu
    Here is the latest in my link-listing series.  Also check out my VS 2010 and .NET 4 series and ASP.NET MVC 2 series for other on-going blog series I’m working on. [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu] ASP.NET MVC How to Localize an ASP.NET MVC Application: Michael Ceranski has a good blog post that describes how to localize ASP.NET MVC 2 applications. ASP.NET MVC with jTemplates Part 1 and Part 2: Steve Gentile has a nice two-part set of blog posts that demonstrate how to use the jTemplate and DataTable jQuery libraries to implement client-side data binding with ASP.NET MVC. CascadingDropDown jQuery Plugin for ASP.NET MVC: Raj Kaimal has a nice blog post that demonstrates how to implement a dynamically constructed cascading dropdownlist on the client using jQuery and ASP.NET MVC. How to Configure VS 2010 Code Coverage for ASP.NET MVC Unit Tests: Visual Studio enables you to calculate the “code coverage” of your unit tests.  This measures the percentage of code within your application that is exercised by your tests – and can give you a sense of how much test coverage you have.  Gunnar Peipman demonstrates how to configure this for ASP.NET MVC projects. Shrinkr URL Shortening Service Sample: A nice open source application and code sample built by Kazi Manzur that demonstrates how to implement a URL Shortening Services (like bit.ly) using ASP.NET MVC 2 and EF4.  More details here. Creating RSS Feeds in ASP.NET MVC: Damien Guard has a nice post that describes a cool new “FeedResult” class he created that makes it easy to publish and expose RSS feeds from within ASP.NET MVC sites. NoSQL with MongoDB, NoRM and ASP.NET MVC Part 1 and Part 2: Nice two-part blog series by Shiju Varghese on how to use MongoDB (a document database) with ASP.NET MVC.  If you are interested in document databases also make sure to check out the Raven DB project from Ayende. Using the FCKEditor with ASP.NET MVC: Quick blog post that describes how to use FCKEditor – an open source HTML Text Editor – with ASP.NET MVC. ASP.NET Replace Html.Encode Calls with the New HTML Encoding Syntax: Phil Haack has a good blog post that describes a useful way to quickly update your ASP.NET pages and ASP.NET MVC views to use the new <%: %> encoding syntax in ASP.NET 4.  I blogged about the new <%: %> syntax – it provides an easy and concise way to HTML encode content. Integrating Twitter into an ASP.NET Website using OAuth: Scott Mitchell has a nice article that describes how to take advantage of Twiter within an ASP.NET Website using the OAuth protocol – which is a simple, secure protocol for granting API access. Creating an ASP.NET report using VS 2010 Part 1, Part 2, and Part 3: Raj Kaimal has a nice three part set of blog posts that detail how to use SQL Server Reporting Services, ASP.NET 4 and VS 2010 to create a dynamic reporting solution. Three Hidden Extensibility Gems in ASP.NET 4: Phil Haack blogs about three obscure but useful extensibility points enabled with ASP.NET 4. .NET 4 Entity Framework 4 Video Series: Julie Lerman has a nice, free, 7-part video series on MSDN that walks through how to use the new EF4 capabilities with VS 2010 and .NET 4.  I’ll be covering EF4 in a blog series that I’m going to start shortly as well. Getting Lazy with System.Lazy: System.Lazy and System.Lazy<T> are new features in .NET 4 that provide a way to create objects that may need to perform time consuming operations and defer the execution of the operation until it is needed.  Derik Whittaker has a nice write-up that describes how to use it. LINQ to Twitter: Nifty open source library on Codeplex that enables you to use LINQ syntax to query Twitter. Visual Studio 2010 Using Intellitrace in VS 2010: Chris Koenig has a nice 10 minute video that demonstrates how to use the new Intellitrace features of VS 2010 to enable DVR playback of your debug sessions. Make the VS 2010 IDE Colors look like VS 2008: Scott Hanselman has a nice blog post that covers the Visual Studio Color Theme Editor extension – which allows you to customize the VS 2010 IDE however you want. How to understand your code using Dependency Graphs, Sequence Diagrams, and the Architecture Explorer: Jennifer Marsman has a nice blog post describes how to take advantage of some of the new architecture features within VS 2010 to quickly analyze applications and legacy code-bases. How to maintain control of your code using Layer Diagrams: Another great blog post by Jennifer Marsman that demonstrates how to setup a “layer diagram” within VS 2010 to enforce clean layering within your applications.  This enables you to enforce a compiler error if someone inadvertently violates a layer design rule. Collapse Selection in Solution Explorer Extension: Useful VS 2010 extension that enables you to quickly collapse “child nodes” within the Visual Studio Solution Explorer.  If you have deeply nested project structures this extension is useful. Silverlight and Windows Phone 7 Building a Simple Windows Phone 7 Application: A nice tutorial blog post that demonstrates how to take advantage of Expression Blend to create an animated Windows Phone 7 application. If you haven’t checked out my Windows Phone 7 Twitter Tutorial I also recommend reading that. Hope this helps, Scott P.S. If you haven’t already, check out this month’s "Find a Hoster” page on the www.asp.net website to learn about great (and very inexpensive) ASP.NET hosting offers.

    Read the article

1