@@ -9,11 +9,11 @@ each other.
99Usage
1010-----
1111
12- Capture the JSON data (maybe using @people .to_json)
12+ Capture the JSON data (maybe using @people .to_json).Here 'id' field is mandatory in all json records and it should be uniq.
1313
14- var people = [{person: {name: 'Jiren', age:26, country: 'India', country_id: 1,
14+ var people = [{person: {id: 1, name: 'Jiren', age:26, country: 'India', country_id: 1,
1515 states : [{ state : 'MH', state_id : 3 }, {state : 'HN', state_id : 4}] } },
16- {person: {name: 'Joe', age:25, country: 'USA', country_id: 2,
16+ {person: {id: 2, name: 'Joe', age:25, country: 'USA', country_id: 2,
1717 states : [{ state : 'MH', state_id : 3 }, {state : 'HN', state_id : 4}] } }
1818 ]
1919
@@ -120,6 +120,9 @@ Triggering the filter
120120This will render each JSON object to html and append to '#people_list' div.
121121Second arg is object render function which can be customized as show above.
122122
123+ NOTE: Initially where html element going to render and append must be empty.Here '#people_list' div is empty.
124+
125+
123126Filter using link
124127-----------------
125128
@@ -145,6 +148,22 @@ Bind event on filter link and clear filter link. Here on click link data-value s
145148 fJS.filter();
146149 });
147150
151+ Javascript Template Integration
152+ -------------------------------
153+ Template must have parent any html tag.
154+ i.e
155+
156+ incorrect:
157+
158+ <span class="name">{{name}}</span>
159+ <span class="age">{{age}}</span>
160+
161+ correct:
162+
163+ <div>
164+ <span class="name">{{name}}</span>
165+ <span class="age">{{age}}</span>
166+ </div>
148167
149168Mustache.js integration
150169-----------------------
0 commit comments