1+ < html >
2+ < head >
3+ < title > Render | CoCreateJS</ title >
4+
5+ <!-- CoCreate Favicon -->
6+ < link rel ="icon " href ="https://cdn.cocreate.app/favicon.ico " type ="image/ico " sizes ="16x16 ">
7+ </ head >
8+ < body >
9+
10+ < div data-template_id ="abc1 " data-fetch_collection ="render_test ">
11+ < div class ="template card {{render2.collection}} card margin:10px firstname "
12+ data-value ="{{render2.data._id}} "
13+ data-template_id ="abc1 "
14+ data-render_array ="render2.data ">
15+ < div class ="card-body padding:15px " data-collection ="{{render2.collection}} ">
16+ < h3 class ="{{render2.data.firstname}} blue " value ="{{render2.data.lastname}} - {{render2.data.firstname}} "> --</ h3 >
17+ < h3 data-value ="{{ render2.data.lastname }} " value ="{{lastname}} "> </ h3 >
18+ < input value ="{{ render2.collection }} "/>
19+ < h3 class ="email " value ="{{render2.data.email}} "> --</ h3 >
20+ < textarea value ="{{render2.data.lastname}} "> </ textarea >
21+ < h3 data-attribute ="{{render2.data.personal_info.email}} " name ="email " value ="{{render2.data.personal_info.email}} "> </ h3 >
22+
23+ < div class ="template card "
24+ data-render_array ="render2.data.testing_array ">
25+
26+ < h3 data-attribute ="{{render2.data.testing_array.email}} " name ="email " class ="{{render2.data.testing_array.email}} " value ="{{render2.data.testing_array.email}} "> </ h3 >
27+ < h3 value ="{{render2.collection}} "> </ h3 >
28+
29+ < h3 value ="{{render2.data.personal_info.email}} "> </ h3 >
30+ < div > *******************************************</ div >
31+ </ div >
32+ < div class ="template card "
33+ data-render_array ="render2.data.string_array " data-render_key ="string_ ">
34+
35+ < h3 name ="test "
36+ data-attribute ="{{string_.--}} "
37+ class ="{{string_.--}} "
38+ value ="{{string_.--}} "> </ h3 >
39+
40+ </ div >
41+
42+ </ div >
43+ </ div >
44+ </ div >
45+
46+
47+ < pre >
48+ < h1 > Paste in your browser console</ h1 >
49+
50+ /** Example of array object from db -- render2 is an example of data-render_id**/
51+ CoCreate.render.data({
52+ selector: '[data-template_id=abc1]',
53+ data: {
54+ render2: {
55+ collection : 'dededede',
56+ data: [{
57+ _id : '123kijfhgfkel45',
58+ firstname : 'Jin',
59+ lastname : 'codingmachinine',
60+ personal_info : {email:'jeanmendozar@gmail.com','phone':'56666'},
61+ email: 'tesing@gamil.com',
62+ testing_array : [
63+ {email:'jeanmendozar@gmail.com','phone':'0','home':'home1'},
64+ {email:'frank@gmail.com','phone':'1','home':'home2'},
65+ {email:'jose@gmail.com','phone':'2','home':'home3'},
66+ {email:'juan@gmail.com','phone':'3','home':'home4'},
67+ {email:'kooo@gmail.com','phone':'4','home':'home5'},
68+ ],
69+ string_array: ['string1', 'string2', 1, 3]
70+ },{
71+ _id : '5678efe32qd2ol',
72+ firstname : 'jean',
73+ lastname : 'Mendoza',
74+ personal_info : {email:'jeanmendozar@gmail.com','phone':'56666'},
75+ email: 'tesing2@gamil.com',
76+ testing_array : [
77+ {email:'1jeanmendozar@gmail.com','phone':'10','home':'home11'},
78+ {email:'1frank@gmail.com','phone':'11','home':'home12'},
79+ {email:'1jose@gmail.com','phone':'12','home':'home13'},
80+ {email:'1juan@gmail.com','phone':'13','home':'home14'},
81+ {email:'1kooo@gmail.com','phone':'14','home':'home15'},
82+ {email:'1allask@gmail.com','phone':'15','home':'home16'},
83+ {email:'1ana@gmail.com','phone':'16','home':'home17'},
84+ {email:'1rosa@gmail.com','phone':'17','home':'home18'},
85+ {email:'1nuevo@gmail.com','phone':'18','home':'home19'}
86+ ],
87+ string_array: ['string1', 'string2', 1, 3]
88+ },
89+ ]
90+ }
91+ }
92+ })
93+
94+ </ pre >
95+ < script >
96+ var config = {
97+ apiKey : 'c2b08663-06e3-440c-ef6f-13978b42883a' ,
98+ organization_Id : '5de0387b12e200ea63204d6c'
99+ }
100+ </ script >
101+
102+ <!-- CoCreate JS CDN -->
103+ < script src ="../dist/CoCreate-render.js " > </ script >
104+ </ body >
105+ </ html >
0 commit comments