{"id":21901351,"url":"https://github.com/demogorgorn/yii2-jquery-sortable","last_synced_at":"2025-06-29T14:33:21.508Z","repository":{"id":56965308,"uuid":"82394569","full_name":"demogorgorn/yii2-jquery-sortable","owner":"demogorgorn","description":"Create a flexible, opinionated sorting plugin for jQuery with nesting support","archived":false,"fork":false,"pushed_at":"2017-03-16T05:14:33.000Z","size":14,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-25T11:26:48.982Z","etag":null,"topics":["extension","nested","nested-objects","php","sortable","widget","yii2"],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/demogorgorn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-18T15:06:28.000Z","updated_at":"2020-08-22T20:27:58.000Z","dependencies_parsed_at":"2022-08-21T09:20:35.481Z","dependency_job_id":null,"html_url":"https://github.com/demogorgorn/yii2-jquery-sortable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/demogorgorn/yii2-jquery-sortable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demogorgorn%2Fyii2-jquery-sortable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demogorgorn%2Fyii2-jquery-sortable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demogorgorn%2Fyii2-jquery-sortable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demogorgorn%2Fyii2-jquery-sortable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/demogorgorn","download_url":"https://codeload.github.com/demogorgorn/yii2-jquery-sortable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demogorgorn%2Fyii2-jquery-sortable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262388722,"owners_count":23303321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["extension","nested","nested-objects","php","sortable","widget","yii2"],"created_at":"2024-11-28T15:13:15.287Z","updated_at":"2025-06-29T14:33:21.481Z","avatar_url":"https://github.com/demogorgorn.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery (Johnny) Sortable for Yii 2\n=====================================\n\nThis is the useful widget for, in my humble opinion, the most powerful and flexible, opinionated sorting plugin for jQuery.\nWhy another sortable plugin? you might ask. Aren't there many others? \nThe answer is: nested lists. None of the other solutions had a decent support for nested lists. nestedSortable relies on a fixed width hierarchy. Others mimic the way jQuery UI does sortables and therefore require ugly hacks that suffer from sudden jumps.\n\n### Basic Example\n\nThe view:\n```php\n\u003c?php \nuse demogorgorn\\jquerysortable\\Sortable;\n\n$items = [\n        [\n            'content' =\u003e 'First'\n            'options' =\u003e ['class' =\u003e 'panel', 'data-id' =\u003e 12]\n        ],\n        [\n            'content' =\u003e 'Second'\n            'options' =\u003e ['class' =\u003e 'panel', 'data-id' =\u003e 13],\n            'items' =\u003e [\n                [\n                    'content' =\u003e 'Nested 1'\n                    'options' =\u003e ['class' =\u003e 'panel', 'data-id' =\u003e 14]\n                ],\n                [\n                    'content' =\u003e 'Nested 2'\n                    'options' =\u003e ['class' =\u003e 'another class']\n                ],\n\n            ]\n\n        ],\n        \n    ];\n\necho Sortable::widget([\n\n    'listTag' =\u003e 'ol',\n    'autoNestedEnabled' =\u003e true,\n    'useDragHandle' =\u003e FA::icon('bars', ['style' =\u003e 'margin: 4px;']),\n    'options' =\u003e [\n        'class' =\u003e 'vertical',\n        'id' =\u003e 'menulist',\n    ],\n    'items'=\u003e $items,\n    'clientOptions' =\u003e [\n        'handle' =\u003e '.fa-bars',\n        'onDragStart' =\u003e new \\yii\\web\\JsExpression('function ($item, container, _super) {\n                // Duplicate items of the no drop area\n                if(!container.options.drop)\n                    $item.clone().insertAfter($item);\n                    _super($item, container);\n        }'),\n\n    ],\n]); ?\u003e\n```\n\n### Widget's options\n\nVariable | Description | Type\n------------ | ------------- | -------------\nclientOptions | JS widget options | Array\noptions | HTML attributes and other options of the widget's container tag | Array\nitems | array of the sortable items configuration for rendering elements within the sortable list / grid. | Array\nlistTag | the tag to use for a container | String\nuseDragHandle | whether the handle for drag should be used. If you want to use drag handle just specify it's html code: e.g., _\u003ci class=\"fa fa-bars\"\u003e\u003c/i\u003e_. Please notice that you should set the handle param in clientOptions manually. E.g. '.fa-bars'. By default is set to false. | Boolean / String\nautoNestedEnabled | enable auto nested mode. By default Sortable support nested lists only in cases when these nested lists were defined when Sortable was initialized. | Boolean\nappendElement | HTML element which will be appended to each list item. To disable set it to false. | Boolean / String\n\n*Please note You can set the following properties:*\n\n     * content: string, the list item content (this is not HTML encoded)\n     * disabled: bool, whether the list item is disabled\n     * options: array, the HTML attributes for the list item.\n\n## Installation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\nphp composer.phar require demogorgorn/yii2-jquery-sortable \"*\"\n```\n\nor add\n\n```\n\"demogorgorn/yii2-jquery-sortable\": \"*\"\n```\n\nto the require section of your `composer.json` file and run `composer update`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemogorgorn%2Fyii2-jquery-sortable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdemogorgorn%2Fyii2-jquery-sortable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemogorgorn%2Fyii2-jquery-sortable/lists"}