README.md in dynaspan-0.1.0 vs README.md in dynaspan-0.1.1
- old
+ new
@@ -21,11 +21,15 @@
dynaspan_text_field(@article, comment, :note, '[edit]')
Example #2:
dynaspan_text_field(profile, profile.websites, :url, '[edit]',
- {hidden_field: {page_name: 'page2'}, callback_on_update: "alert('Awesome!');"})
+ {
+ hidden_fields: {page_name: 'page2'},
+ callback_on_update: "alert('Awesome!');"
+ }
+ )
This will show the value of note in the comment object as plain text. It can be clicked on to instantly become a text field input. And once unselected the `@article` object will update with its nested attribute object `comment` and its new value in the `note` attribute.
You can use either `dynaspan_text_field` or `dynaspan_text_area` in any of your views. There are two mandatory parameters. The first is a the main Object model instance you will be updating. And the other mandatory field is the symbol of the attribute to update. There are two optional fields. The first is the nested attribute object which will have its field updated. And the last is the optional text for `[edit]`-ing (clicking on to edit which is useful for blank fields).
@@ -70,9 +74,25 @@
margin-top:-24px;
}
```
###What's New
+
+####Version 0.1.1
+
+Added a JavaScript callback that will **append** a Hash/Dictionary of the updated Dynaspan Object to the end of your
+functions parameters. The method is named **callback_with_values**.
+
+ {
+ callback_with_values: "console.log();"
+ }
+
+This will be called everytime the Dynaspan field submits and it will **inject** the following result **as the last parameter**:
+
+ {
+ ds_selector: "dyna_span_unique_label<#>",
+ ds_input: "the entered text from the input field"
+ }
####Version 0.1.0
Added the same hidden_fields from version 0.0.8 to support non-nested Objects. You can use them now on anything.