add wysi input, refactor all inputs to append $tpl to form before render()
This commit is contained in:
src
containers
editable-form
inputs-ext
address
inputs
test
@ -36,7 +36,7 @@ $(function(){
|
||||
@method render()
|
||||
**/
|
||||
render: function() {
|
||||
Address.superclass.render.call(this);
|
||||
this.$input = this.$tpl.find('input');
|
||||
},
|
||||
|
||||
/**
|
||||
@ -111,9 +111,9 @@ $(function(){
|
||||
@param {mixed} value
|
||||
**/
|
||||
value2input: function(value) {
|
||||
this.$input.find('input[name="city"]').val(value.city);
|
||||
this.$input.find('input[name="street"]').val(value.street);
|
||||
this.$input.find('input[name="building"]').val(value.building);
|
||||
this.$input.filter('[name="city"]').val(value.city);
|
||||
this.$input.filter('[name="street"]').val(value.street);
|
||||
this.$input.filter('[name="building"]').val(value.building);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -123,9 +123,9 @@ $(function(){
|
||||
**/
|
||||
input2value: function() {
|
||||
return {
|
||||
city: this.$input.find('input[name="city"]').val(),
|
||||
street: this.$input.find('input[name="street"]').val(),
|
||||
building: this.$input.find('input[name="building"]').val()
|
||||
city: this.$input.filter('[name="city"]').val(),
|
||||
street: this.$input.filter('[name="street"]').val(),
|
||||
building: this.$input.filter('[name="building"]').val()
|
||||
};
|
||||
},
|
||||
|
||||
@ -135,7 +135,7 @@ $(function(){
|
||||
@method activate()
|
||||
**/
|
||||
activate: function() {
|
||||
this.$input.find('input[name="city"]').focus();
|
||||
this.$input.filter('[name="city"]').focus();
|
||||
},
|
||||
|
||||
/**
|
||||
@ -144,7 +144,7 @@ $(function(){
|
||||
@method autosubmit()
|
||||
**/
|
||||
autosubmit: function() {
|
||||
this.$input.find('input[type="text"]').keydown(function (e) {
|
||||
this.$input.keydown(function (e) {
|
||||
if (e.which === 13) {
|
||||
$(this).closest('form').submit();
|
||||
}
|
||||
|
Reference in New Issue
Block a user