Ver código fonte

Docs, remove mention of private API: jQuery's data in <OPTION> elements

Stan Senotrusov 9 anos atrás
pai
commit
f2ae054f21
1 arquivos alterados com 3 adições e 4 exclusões
  1. 3 4
      docs/_includes/options/data/selection-access.html

+ 3 - 4
docs/_includes/options/data/selection-access.html

@@ -12,16 +12,15 @@ $('select').select2('data');
 {% endhighlight %}
 
   <p>
-    As Select2 uses the HTML <code>&lt;SELECT&gt;</code> element to store the selection result, the selection data are represented by <code>&lt;OPTION&gt;</code> elements and can be accessed in the plain jQuery/DOM manner. The resulting elements will have properties/values from the source data objects, stored by the means of jQuery <code>data()</code> method and accessible by key <code>'data'</code>:
+    As Select2 uses the HTML <code>&lt;SELECT&gt;</code> element to store the selection result, the selection data are represented by <code>&lt;OPTION&gt;</code> elements and can be accessed in the plain jQuery/DOM manner:
   </p>
 
 {% highlight js linenos %}
-// Retrieve source data object's data of the first selected element
-$('select').find(':selected').data('data');
+$('select').find(':selected');
 {% endhighlight %}
 
   <p>
-    Another technique is not to rely on jQuery's <code>data()</code> method but to extend the <code>&lt;OPTION&gt;</code> elements representing selection with the HTML data-* attributes containing arbitrary data from the source data objects:
+    It is possible to extend the <code>&lt;OPTION&gt;</code> elements representing selection with the HTML data-* attributes containing arbitrary data from the source data objects:
   </p>
 
 {% highlight js linenos %}