That way every time you 'scan' an event triggers an Ajax call to redraw that sequence with a new element.
To do this you will need your own version of the sequence and item templates with a callback section that contains the Ajax.
We've overridden a select box to return results via an Ajax call to a database.
Try and find what you want without deform and then go from there.
--
You received this message because you are subscribed to a topic in the Google Groups "pylons-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pylons-discuss/3dtmfCBvM9E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/b990ffe6-92d6-4dc0-b9ec-a1c39de681cc%40googlegroups.com.
The Sequence widget has also a min_len attribute
http://docs.pylonsproject.org/projects/deform/en/latest/api.html#deform.widget.SequenceWidget
>
> However if I don't know ahead of time how many rows I'll need, the
> user will at some point have to add rows. How do I get one of the
> behaviours below (top-most is most preferred):-
>
> 1. As user scans one qrcode and presses 'enter', a new row is
> automatically created. This breaks 'enter-to-submit', but that's okay
> for this case.
You'll need to add some custom javascript code to perform this behaviour.
In the case your sequence items are only composed of the qrcode field,
something like this should work :
$('input[name=qrcode]').keypress(function(event){
|if(e.which ==13){
deform.appendSequenceItem(this);
| ||// prevent form submission|
return false;
}|
});
$('input[name="qr_code"]').keypress(function(event) {
if (event.keyCode == 13) {
deform.appendSequenceItem(this);
return false;
}
});