Sha256: 3629e29aa397238a41dd5c45cf3cc1d0b2b35f6a964968eb37327b6c3514361f
Contents?: true
Size: 1.91 KB
Versions: 15
Compression:
Stored size: 1.91 KB
Contents
<!DOCTYPE html> <html> <head> <link href="resources/presentation.css" rel="stylesheet" type="text/css" /> <link href="resources/syntaxhighlighter.css" rel="stylesheet" type="text/css" /> <script src="resources/syntaxhighlighter.min.js" type="text/javascript"></script> <script src="http://code.jquery.com/jquery.js" type="text/javascript"></script> <script src="../../jsrender.js" type="text/javascript"></script> <script src="../../jquery.observable.js" type="text/javascript"></script> <script src="../../jquery.views.js" type="text/javascript"></script> </head> <body> <a href="06_data-binding.html">Prev</a> <a href="index.html">Home</a> <a href="07_observable.html">Next</a><br /> <h3>7 Data binding: JsViews - compact linking API syntax</h3> <!--====== Container ======--> <table><tbody id="details"></tbody></table> <!--====== Template ======--> <script id="personTmpl" type="text/x-jsrender"> <tr> <td data-link="firstName" /> <td> <input data-link="firstName" /> </td> </tr> </script> <!--====== Script ======--> <script type="text/javascript"> var people = [ { firstName: "Jeff" }, { firstName: "Rebecca" } ]; // Compile template $.templates( "personTmpl", "#personTmpl" ); // Render and link (compact syntax): data-link people to the // details container, using the personTmpl template $.link.personTmpl( "#details", people ); </script> <!--================ End of Demo Section ================--> <h4>HTML:</h4> <pre class="brush: xml;"> <!-- Template, with declarative data binding expressions --> ... <td data-link="firstName" /> <td> <input data-link="firstName" /> </td> ... </pre> <h4>Script:</h4> <pre class="brush: js;"> // Compile template $.templates( "personTmpl", "#personTmpl" ); // Render and link (compact syntax): data-link details // container element to people, using the personTmpl template $.link.personTmpl( "#details", people ); </pre> </body> </html>
Version data entries
15 entries across 15 versions & 1 rubygems