|
@@ -35,6 +35,16 @@ $('select').select2({
|
|
|
|
|
|
// Retrieve custom attribute value of the first selected element
|
|
// Retrieve custom attribute value of the first selected element
|
|
$('select').find(':selected').attr('data-custom-attribute')
|
|
$('select').find(':selected').attr('data-custom-attribute')
|
|
|
|
+{% endhighlight %}
|
|
|
|
+
|
|
|
|
+ <p>
|
|
|
|
+ In addition, properties/values from source data objects can ba accessed from within event handler:
|
|
|
|
+ </p>
|
|
|
|
+
|
|
|
|
+{% highlight js linenos %}
|
|
|
|
+$('select').on('select2:select', function (event) {
|
|
|
|
+ console.log(event.params.data)
|
|
|
|
+});
|
|
{% endhighlight %}
|
|
{% endhighlight %}
|
|
|
|
|
|
</section>
|
|
</section>
|