Skip to content

Commit

Permalink
Add jquery ui doc (#7618)
Browse files Browse the repository at this point in the history
* Add jquery ui doc

* Update recipe_jquery_ui.rst
  • Loading branch information
VincentLanglet committed Nov 26, 2021
1 parent be46a40 commit bdc065f
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/cookbook/recipe_bootlint.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Bootlint
========

The admin comes with `Bootlint`_ integration
since version 3.0. Bootlint is an HTML linter for Bootstrap projects.
The admin comes with `Bootlint`_ integration.
Bootlint is an HTML linter for Bootstrap projects.

You should use it when you want add some contributions on Sonata UI to check
the eventual Twitter Bootstrap conventions' mistakes.
Expand Down
4 changes: 2 additions & 2 deletions docs/cookbook/recipe_icheck.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
iCheck
======

The admin comes with `iCheck <http://icheck.fronteed.com/>`_ integration
since version 3.0.0. iCheck is a jQuery based checkbox and radio buttons skinning plugin.
The admin comes with `iCheck <http://icheck.fronteed.com/>`_ integration.
iCheck is a jQuery based checkbox and radio buttons skinning plugin.
It provides a cross-browser and accessible solution to checkboxes and radio buttons customization.

The iCheck plugin is enabled on all ``checkbox`` and ``radio`` form elements by default.
Expand Down
39 changes: 39 additions & 0 deletions docs/cookbook/recipe_jquery_ui.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Jquery UI
=========

The admin only comes with the `Jquery UI Sortable plugin`_.

Adding another jQuery UI plugin
-------------------------------

To add another jQuery UI plugin in your admin, you have to tell
webpack encore to not provide another instance of jQuery thanks
to the `addExternals` method:

.. code-block:: javascript
// webpack.config.js
let Encore = require('@symfony/webpack-encore');
Encore
.addExternals({ jquery: 'jQuery' })
.addEntry('sonata', './assets/js/sonata.js')
And then adding the one you need in your own js files (don't forget to load it in your template):

.. code-block:: javascript
// assets/js/sonata.js
import $ from 'jquery';
import 'jquery-ui/ui/widget';
import 'jquery-ui/ui/widgets/draggable';
$('.foo').draggable(); // The new UI plugin can be used.
$('.bar').sortable(); // The already loaded by sonata plugin can be used too.
.. _`Jquery UI Sortable plugin`: https://jqueryui.com/sortable/
4 changes: 2 additions & 2 deletions docs/cookbook/recipe_select2.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Select2
=======

The admin comes with `select2 <https://select2.org/>`_ integration
since version 2.2.6. Select2 is a jQuery based replacement for select boxes.
The admin comes with `select2 <https://select2.org/>`_ integration.
Select2 is a jQuery based replacement for select boxes.
It supports searching, remote data sets, and infinite scrolling of results.

The select2 is enabled on all ``select`` form elements by default.
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ The demo website can be found at https://demo.sonata-project.org.

cookbook/recipe_select2
cookbook/recipe_icheck
cookbook/recipe_jquery_ui
cookbook/recipe_knp_menu
cookbook/recipe_file_uploads
cookbook/recipe_image_previews
Expand Down

0 comments on commit bdc065f

Please sign in to comment.