<terminal>
/**
*    @Author: Arash Karimzadeh
*    @Email: me@arashkarimzadeh.com
*    @Desciption: Here, I post some of my recent
*    researches. Also you can see my code projects.
*/  
Ajax C # Chrome CMS dateNet Design Patterns includeMany JavaScript jBind Joomla jQuery Plugin rails ror RubyOnRails SQLite xul

+ All tags

Content View Hits : 227399
Bookmark and Share
jBind 1.5.0 to 1.5.1 PDF Print E-mail
Written by Arash Karimzadeh   
Tuesday, 27 January 2009 15:54

jBind 1.5.0 has been updated to 1.5.1.

This new version support Partial template, now you can bind parts of your aggregate data to a template.

jBind 1.5.1 and Partial Template

This new release support partial template:

In all jBind previous version when we wanted to map just part of aggregate data to template we was forced to define the blank template for inner objects which we wanted to by pass.

For example below we wanted to pass Publication:

  1. var data = [
  2. {
  3. id:41,
  4. name:'Scott',
  5. family:'Adams',
  6. education:'Economics',
  7. history:"Scott Adams was born in Windham, New York in 1957 and received ...",
  8. birthdate: {month:'June',date:8,year:1957},
  9. Publications: [{book:'The Dilbert Future',year:1997},{book:'The Dilbert Principle',year:1996}]
  10. },
  11. {
  12. id:59,
  13. name:'Jack',
  14. family:'Welch',
  15. education:'Chemical Engineering',
  16. history:'Jack Welch was born in Peabody, Massachusetts to John, ...',
  17. birthdate: {month:'November',date:19,year:1935},
  18. Publications: [{book:'Winning',year:2005}]
  19. }
  20. ];
  21. var node = $(template).bindTo(data);
  22. $(node).appendTo('#show');
 

In jBind 1.5.0 we had to define something like this:

  1. <div class="content">
  2. <!--data-->
  3. <div class="viewBlock" id='{id}'>
  4. #{id}<br/>
  5. <b>{name} {family}</b>,<br/>
  6. <i>{education}</i>,<br/>
  7. {history}
  8. <!--birthdate-->
  9. <div class='age'>
  10. {month} {date} {year}
  11. </div>
  12. <!--birthdate-->
  13. <!--Publications-->
  14. <!--Publications-->
  15. </div>
  16. <!--data-->
  17. </div>
 

In jBind 1.5.1 I simplified the templating. You can ignore the inner template and jBind will bypass it automatically:

  1. <div class="content">
  2. <!--data-->
  3. <div class="viewBlock" id='{id}'>
  4. #{id}<br/>
  5. <b>{name} {family}</b>,<br/>
  6. <i>{education}</i>,<br/>
  7. {history}
  8. <!--birthdate-->
  9. <div class='age'>
  10. {month} {date} {year}
  11. </div>
  12. <!--birthdate-->
  13. </div>
  14. <!--data-->
  15. </div>
 

Check downloads for jBind sample or click here.

You can read more about jBind here

Special thanks to Reza Owliaei who has reported this issue.

 

Tags: jBind | jQuery | Plugin

Last Updated on Tuesday, 27 January 2009 16:24
 
</terminal>