example of how to use Pure and input fields

0 views
Skip to first unread message

bartb

unread,
Oct 27, 2009, 4:37:59 AM10/27/09
to PURE - JavaScript Templates Engine
Hi,

I keep getting a error message (Error: NO_MODIFICATION_ALLOWED_ERR:
DOM Exception 7) in Safari when I try to render a table with INPUT
fields. It works when I leave the INPUT.cancellation directive out.

Does anyone have a working example of how to use Input fields?

Here is my non-working example:


Self.htmlExamens = $( '#exams tbody' );

var directivesExams = {
'tr' : {
'examen<-': {
'td.examcode': 'examen.EXAMCODE',
'td.examdescription': 'examen.EXAMDESCRIPTION',
'input.cancellation[value]': 'examen.CANCELLATION'
},
}
};

Self.templateExams = Self.htmlExams.compile
( directivesExams );



<table id="exams" class="exams">
<thead>
<tr>
<th>Exam</th>
<th></th>
<th>Cancelation</th>
</tr>
</thead>
<tbody>
<tr class="examen">
<td class="examcode"></td>
<td class="examdescription"></td>
<td><input type="text" class="cancellation"
name="cancelation" value="" size="10" /></td>
</tr>
</tbody>
</table>


regars, Bart

bartb

unread,
Oct 27, 2009, 4:47:18 AM10/27/09
to PURE - JavaScript Templates Engine
Self.htmlExamens = $( '#exams tbody' ); ===should be===>
Self.htmlExams = $( '#exams tbody' );

but the problem still stands...

Mic Cvilic

unread,
Oct 27, 2009, 10:27:50 AM10/27/09
to Pure-Unobtrusive...@googlegroups.com
The attributes in the pure2 are not anymore set with [ ... ] but with a
@ in directives.

input.cancellation[value] --> input.cancellation@value

Cheers,
Mic

bartb

unread,
Oct 27, 2009, 5:27:27 PM10/27/09
to PURE - JavaScript Templates Engine
Ha! Thank you! I did not see that one...

cheers, Bart
Reply all
Reply to author
Forward
0 new messages