浏览代码

Added initial questions for tagging docs

Kevin Brown 9 年之前
父节点
当前提交
68a199fc98
共有 2 个文件被更改,包括 51 次插入0 次删除
  1. 1 0
      docs/_includes/options/dropdown.html
  2. 50 0
      docs/_includes/options/dropdown/tagging.html

+ 1 - 0
docs/_includes/options/dropdown.html

@@ -5,5 +5,6 @@
 
   {% include options/dropdown/filtering.html %}
   {% include options/dropdown/selections.html %}
+  {% include options/dropdown/tagging.html %}
   {% include options/dropdown/placement.html %}
 </section>

+ 50 - 0
docs/_includes/options/dropdown/tagging.html

@@ -0,0 +1,50 @@
+<section>
+  <h2>
+    Can options be created based on the search term?
+  </h2>
+
+  <h3>
+    How do I enable tagging?
+  </h3>
+
+{% highlight js linenos %}
+$('select').select2({
+  tags: true
+});
+{% endhighlight %}
+
+  {% include options/not-written.html %}
+
+  <h3>
+    Does tagging work with a single select?
+  </h3>
+
+  {% include options/not-written.html %}
+
+  <h3>
+    How do I add extra properties to the tag?
+  </h3>
+
+  {% include options/not-written.html %}
+
+  <h3>
+    Can I control when tags are created?
+  </h3>
+
+  {% include options/not-written.html %}
+
+  <h3>
+    How do I control the placement of the option?
+  </h3>
+
+{% highlight js linenos %}
+$('select').select2({
+  insertTag: function (data, tag) {
+    // Insert the tag at the end of the results
+    data.push(tag);
+  }
+});
+{% endhighlight %}
+
+  {% include options/not-written.html %}
+</section>