{"id":10609,"date":"2022-10-10T13:10:23","date_gmt":"2022-10-10T10:10:23","guid":{"rendered":"https:\/\/dhtmlx.com\/blog\/?p=10609"},"modified":"2024-08-10T14:02:02","modified_gmt":"2024-08-10T11:02:02","slug":"dhtmlx-to-do-list-1-1","status":"publish","type":"post","link":"https:\/\/dhtmlx.com\/blog\/dhtmlx-to-do-list-1-1\/","title":{"rendered":"DHTMLX To Do List 1.1 with Multiselect and Bulk Actions, Drag-and-Drop, Tasks Sorting, and More"},"content":{"rendered":"<p>Today, we are happy to present DHTMLX To Do List v1.1. Even though it falls under the category of a minor release, this update is a significant step forward in the maturity and usability of the product. <\/p>\n<p>We introduce a pack of useful features that will help end-users to handle their lists of errands much easier and faster. From now on, it is possible to work with any number of tasks and move them around with drag-and-drop, sort lists according to various criteria, show and hide completed tasks, and more. For convenient implementation of new features, the API of our <a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxTodo\/\" rel=\"noopener\" target=\"_blank\">JavaScript To Do List<\/a> now has a collection of new methods, events, and parameters.<\/p>\n<p><strong><a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxTodo\/download.shtml\" rel=\"noopener\" target=\"_blank\">Download the new version of DHTMLX To Do List ><\/a><\/strong><\/p>\n<p>In this article, we offer detailed highlights of the new capabilities provided in v1.1.<\/p>\n<h5>Drag-and-Drop Support<\/h5>\n<p>One of the most significant novelties aimed to contribute to a better user experience with our JavaScript To Do List is <a href=\"https:\/\/docs.dhtmlx.com\/todolist\/guides\/configuration\/#drag-n-drop\" rel=\"noopener\" target=\"_blank\">drag-and-drop support<\/a>. In practice, it allows vertically rearranging any number of tasks with related subtasks to new places and desired levels of nesting at once. When dragging selected tasks, end-users can copy them by pressing the Alt key. When your JavaScript To Do List is operated via touch devices, this useful functionality works with 500ms delay. It helps to enhance the smoothness of the interface and prevent unintended resets.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2022\/10\/drag-and-drop.gif\" alt=\"v1.1 - drag-and-drop\" width=\"800\" height=\"724\" class=\"aligncenter size-full wp-image-10610\" \/><a href=\"https:\/\/snippet.dhtmlx.com\/3vwlbwee?tag=todolist&#038;mode=wide\" rel=\"noopener\" target=\"_blank\">Check the sample ><\/a><\/p>\n<p>Starting from v1.1, drag-and-drop is enabled by default. But it can be disabled by setting the value of the <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/configs\/drag_config\/\" rel=\"noopener\" target=\"_blank\">drag<\/a><\/strong> property to <em>false<\/em>:<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\"><span class=\"kw1\">const<\/span> list <span class=\"sy0\">=<\/span> <span class=\"kw1\">new<\/span> ToDo<span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;#root&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp;tasks<span class=\"sy0\">:<\/span> <span class=\"br0\">&#91;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1&quot;<\/span><span class=\"sy0\">,<\/span> text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Task 1 #tag1&quot;<\/span> <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;...<br \/>\n&nbsp; &nbsp;<span class=\"br0\">&#93;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp;drag<span class=\"sy0\">:<\/span> <span class=\"kw2\">false<\/span> <span class=\"co1\">\/\/ true by default<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>You can also use an extended version of the <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/configs\/drag_config\/\" rel=\"noopener\" target=\"_blank\">drag<\/a><\/strong> property with the <strong>expand<\/strong> parameter for specifying whether tasks with nested subtasks should be collapsed or expanded when you hover over them during drag-and-drop.<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\"><span class=\"kw1\">const<\/span> list <span class=\"sy0\">=<\/span> <span class=\"kw1\">new<\/span> ToDo<span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;#root&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp;tasks<span class=\"sy0\">:<\/span> <span class=\"br0\">&#91;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1&quot;<\/span><span class=\"sy0\">,<\/span> text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Task 1 #tag1&quot;<\/span> <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;...<br \/>\n&nbsp; &nbsp;<span class=\"br0\">&#93;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp;drag<span class=\"sy0\">:<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;expand<span class=\"sy0\">:<\/span> <span class=\"kw2\">false<\/span> <span class=\"co1\">\/\/ true by default<\/span><br \/>\n&nbsp; &nbsp;<span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>There are new <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/events\/startdrag_event\/\" rel=\"noopener\" target=\"_blank\">start-drag<\/a><\/strong>, <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/events\/drag_event\/\" rel=\"noopener\" target=\"_blank\">drag<\/a><\/strong>, and <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/events\/enddrag_event\/\" rel=\"noopener\" target=\"_blank\">end-drag<\/a><\/strong> events that fire at the respective stages of drag-and-drop.<\/p>\n<h5>Multi Select and Bulk Actions<\/h5>\n<p>When managing a list of things to do, it may be necessary to perform certain actions on a group of tasks. Dealing with each task one by one can be tedious and time-consuming. The new version of DHTMLX To Do List helps to optimize this process by providing the ability to <a href=\"https:\/\/docs.dhtmlx.com\/todolist\/#selecting-multiple-tasks\" rel=\"noopener\" target=\"_blank\">select<\/a> any number of tasks and <a href=\"https:\/\/docs.dhtmlx.com\/todolist\/#managing-multiple-tasks\" rel=\"noopener\" target=\"_blank\">manipulate<\/a> them simultaneously. <\/p>\n<p>In v1.1, interactions with a group of tasks are available in the following ways:<br \/>\n1) via keyboard shortcuts<br \/>\nWe added the following keyboard shortcuts that allow selecting list items in various ways:<\/p>\n<ul>\n<li>Ctrl (Cmd)+Click &#8211; for selecting several tasks together with their subtasks<\/li>\n<li>Shift+Click &#8211; for selecting an array of tasks<\/li>\n<li>Shift+ArrowUp &#8211; for selecting a task above the current one<\/li>\n<li>Shift+ArrowDown &#8211; for selecting a task below the current one<\/li>\n<\/ul>\n<p>After that, all selected tasks can be manipulated with already available <a href=\"https:\/\/docs.dhtmlx.com\/todolist\/#managing-multiple-tasks\" rel=\"noopener\" target=\"_blank\">shortcuts<\/a>. In the example below, you can see how to duplicate (Ctrl (Cmd) + D) and indent (Tab) a couple of tasks.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2022\/10\/manipulating-tasks-1.gif\" alt=\"v1.1 - selectinandg and manipulating  tasks\" width=\"800\" height=\"724\" class=\"aligncenter size-full wp-image-10612\" \/><a href=\"https:\/\/snippet.dhtmlx.com\/3vwlbwee?tag=todolist&#038;mode=wide\" rel=\"noopener\" target=\"_blank\">Check the sample ><\/a><\/p>\n<p>2) via a context menu<br \/>\nAlternatively to hotkey combinations, you can similarly handle multiple matters in the list using the context menu that is opened with the right-click.<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2022\/10\/manipulating-tasks-via-context-menu.gif\" alt=\"v1.1 - selecting and manipulating  tasks via context menu\" width=\"800\" height=\"724\" class=\"aligncenter size-full wp-image-10613\" \/><a href=\"https:\/\/snippet.dhtmlx.com\/3vwlbwee?tag=todolist&#038;mode=wide\" rel=\"noopener\" target=\"_blank\">Check the sample ><\/a><\/p>\n<p>3) via API<br \/>\nUsing our updated JavaScript library, you can initialize a To Do List with already selected tasks using the <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/configs\/selected_config\/\" rel=\"noopener\" target=\"_blank\">selected<\/a><\/strong> configuration property as follows:<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\"><span class=\"kw1\">const<\/span> list <span class=\"sy0\">=<\/span> <span class=\"kw1\">new<\/span> ToDo<span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;#root&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp;tasks<span class=\"sy0\">:<\/span> <span class=\"br0\">&#91;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1&quot;<\/span><span class=\"sy0\">,<\/span> text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Task 1&quot;<\/span> <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1.1&quot;<\/span><span class=\"sy0\">,<\/span> text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Task 1.1&quot;<\/span><span class=\"sy0\">,<\/span> parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1&quot;<\/span> <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1.1.1&quot;<\/span><span class=\"sy0\">,<\/span> text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Task 1.1.1&quot;<\/span><span class=\"sy0\">,<\/span> parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1.1&quot;<\/span> <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1.2&quot;<\/span><span class=\"sy0\">,<\/span> text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Task 1.2&quot;<\/span><span class=\"sy0\">,<\/span> parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;1&quot;<\/span> <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2&quot;<\/span><span class=\"sy0\">,<\/span> text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Task 2&quot;<\/span> <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2.1&quot;<\/span><span class=\"sy0\">,<\/span> text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Task 2.1&quot;<\/span><span class=\"sy0\">,<\/span> parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2&quot;<\/span> <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2.1.1&quot;<\/span><span class=\"sy0\">,<\/span> text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Task 2.1.1&quot;<\/span><span class=\"sy0\">,<\/span> parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2.1&quot;<\/span> <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2.2&quot;<\/span><span class=\"sy0\">,<\/span> text<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;Task 2.2&quot;<\/span><span class=\"sy0\">,<\/span> parent<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2&quot;<\/span> <span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp;<span class=\"br0\">&#93;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp;selected<span class=\"sy0\">:<\/span> <span class=\"br0\">&#91;<\/span><span class=\"st0\">&quot;1.1&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;1.2&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;2.2&quot;<\/span><span class=\"br0\">&#93;<\/span><span class=\"sy0\">,<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>To select multiple tasks after the initialization, you should apply the <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/selecttask_method\/\" rel=\"noopener\" target=\"_blank\">selectTask()<\/a><\/strong> method. Previously, it served for selecting only one task at a time using the <strong>ID<\/strong> parameter that identifies a selected task. Now this method takes a new <strong>join<\/strong> parameter that allows adding a task to the list of already selected ones. To bring this parameter into action, you have to set its value to <em>true<\/em>.<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\"><span class=\"kw1\">const<\/span> selected <span class=\"sy0\">=<\/span> <span class=\"br0\">&#91;<\/span><span class=\"st0\">&quot;1.1&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;1.2&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;2.2&quot;<\/span><span class=\"br0\">&#93;<\/span><span class=\"sy0\">;<\/span><br \/>\n<br \/>\n<span class=\"kw1\">for<\/span> <span class=\"br0\">&#40;<\/span>id of selected<span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp;list.<span class=\"me1\">selectTask<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">,<\/span> join<span class=\"sy0\">:<\/span> <span class=\"kw2\">true<\/span> <span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>Otherwise, you&#8217;ll be limited to selecting tasks, since the default value of the <strong>join<\/strong> parameter is <em>false<\/em>.<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\">list.<span class=\"me1\">selectTask<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp;id<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;2.1&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp;join<span class=\"sy0\">:<\/span> <span class=\"kw2\">false<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>The <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/events\/selecttask_event\/\" rel=\"noopener\" target=\"_blank\">select-task<\/a><\/strong> event, which is called when a task is selected, has also been updated with the <strong>join<\/strong> parameter aimed to determine whether one or several tasks have been selected.<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\">list.<span class=\"me1\">api<\/span>.<span class=\"me1\">on<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;select-task&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"br0\">&#40;<\/span><span class=\"br0\">&#123;<\/span>id<span class=\"sy0\">,<\/span> join<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp;console.<span class=\"me1\">log<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;The&quot;<\/span><span class=\"sy0\">,<\/span> id<span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;task is selected&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp;console.<span class=\"me1\">log<\/span><span class=\"br0\">&#40;<\/span>join<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>In order to reset selection of multiple tasks, you should set <em>null<\/em> value to the <strong>id<\/strong> parameter of the <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/unselecttask_method\/\" rel=\"noopener\" target=\"_blank\">unselectTask()<\/a><\/strong> method, thereby invoking the <strong>unselect-task<\/strong> event for each of them.<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\">list.<span class=\"me1\">unselectTask<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#123;<\/span> id<span class=\"sy0\">:<\/span> <span class=\"kw2\">null<\/span> <span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<br \/>\nlist.<span class=\"me1\">api<\/span>.<span class=\"me1\">on<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;unselect-task&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"br0\">&#40;<\/span><span class=\"br0\">&#123;<\/span>id<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp;console.<span class=\"me1\">log<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;The&quot;<\/span><span class=\"sy0\">,<\/span> id<span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;task is unselected&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>We also updated the <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/getselection_method\/\" rel=\"noopener\" target=\"_blank\">getSelection()<\/a><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/unselecttask_method\/\" rel=\"noopener\" target=\"_blank\"><\/a><\/strong> method used to get an array with IDs of selected tasks. Now it has a newly added <strong>sorted<\/strong> parameter taking boolean values. With <strong>sorted: true<\/strong>, you get all selected tasks sorted the same way they are presented in the list, while <strong>sorted: false<\/strong> returns IDs without sorting.<\/p>\n<p>Once all the required tasks are selected, you can start simultaneously managing all of them using common operations (move, copy, paste, duplicate, delete, etc.). It has become possible thanks to a new <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/eachselected_method\/\" rel=\"noopener\" target=\"_blank\">eachSelected()<\/a><\/strong> method that serves for iterating over all selected tasks. This method includes three parameters:<\/p>\n<ul>\n<li><strong>callback<\/strong> &#8211; a callback function for a task specified with the id and index parameters<\/li>\n<li><strong>sorted<\/strong> &#8211; used to determine if IDs of selected tasks should be sorted or not<\/li>\n<li><strong>reversed<\/strong> &#8211; helps to specify the direction of iteration<\/li>\n<\/ul>\n<p>For instance, you can copy and paste all selected tasks (with subtasks) via the <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/copytask_method\/\" rel=\"noopener\" target=\"_blank\">copyTask()<\/a><\/strong> method in the following way:<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\">list.<span class=\"me1\">eachSelected<\/span><span class=\"br0\">&#40;<\/span>id <span class=\"sy0\">=&gt;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp;list.<span class=\"me1\">copyTask<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;id<span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;join<span class=\"sy0\">:<\/span> <span class=\"kw2\">true<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp;<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"sy0\">,<\/span> <span class=\"kw2\">true<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>The <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/copytask_method\/\" rel=\"noopener\" target=\"_blank\">copyTask()<\/a><\/strong> method and the corresponding <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/events\/copytask_event\/\" rel=\"noopener\" target=\"_blank\">copy-task<\/a><\/strong> event also received the new <strong>join<\/strong> parameter that enables you to perform this kind of operation with several tasks.<\/p>\n<p>The list of other available operations on selected tasks can be found in the <a href=\"https:\/\/docs.dhtmlx.com\/todolist\/guides\/multiselection\/#list-of-available-operations\" rel=\"noopener\" target=\"_blank\">documentation<\/a>.<\/p>\n<h5>Sorting Tasks<\/h5>\n<p>At peak activity hours, To Do Lists may be instantly expanded with a large number of tasks, making it hard to quickly prioritize work by hand. To facilitate this part, DHTMLX To Do List v1.1 comes with the ability to <a href=\"https:\/\/docs.dhtmlx.com\/todolist\/guides\/sorting_filtering_tasks\/#sorting-tasks\" rel=\"noopener\" target=\"_blank\">sort tasks<\/a><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/setsort_method\/\" rel=\"noopener\" target=\"_blank\"><\/a> via API and UI.<\/p>\n<p>End-users can sort tasks using the <strong>Sort by<\/strong> control in the Toolbar menu. Here is the list of provided sorting criteria:<\/p>\n<ul>\n<li>by text<\/li>\n<li>by due date<\/li>\n<li>by completion date<\/li>\n<li>by creation date<\/li>\n<li>by editing date<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2022\/10\/sorting-tasks.gif\" alt=\"v1.1 -sorting tasks\" width=\"800\" height=\"724\" class=\"aligncenter size-full wp-image-10614\" \/><a href=\"https:\/\/snippet.dhtmlx.com\/3vwlbwee?tag=todolist&#038;mode=wide\" rel=\"noopener\" target=\"_blank\">Check the sample ><\/a><\/p>\n<p>With these sorting options, end-users will be able to view tasks in a variety of ways and plan their work more effectively.<\/p>\n<p>Under the hood, this feature is integrated using the <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/setsort_method\/\" rel=\"noopener\" target=\"_blank\">setSort()<\/a><\/strong> method, including the following optional parameters:<\/p>\n<ul>\n<li><strong>by<\/strong> &#8211; specifies the sorting criterion (the key of the task property or a search function returning a string)<\/li>\n<li><strong>dir<\/strong> &#8211; sets the sorting order (ascending &#8220;asc&#8221; or descending &#8220;desc&#8221;)<\/li>\n<li><strong>tree<\/strong> &#8211; enables or disables sorting for subtasks (boolean)<\/li>\n<\/ul>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\">list.<span class=\"me1\">setSort<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp;by<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;text&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp;dir<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;asc&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp;tree<span class=\"sy0\">:<\/span> <span class=\"kw2\">false<\/span> <span class=\"co1\">\/\/ set by default, change the value to true to enable sorting for subtasks <\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>The <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/setsort_method\/\" rel=\"noopener\" target=\"_blank\">setSort()<\/a><\/strong> method is complemented with the <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/events\/setsort_event\/\" rel=\"noopener\" target=\"_blank\">set-sort<\/a><\/strong> event that is invoked when sorting tasks. In the <strong>task<\/strong> property, we added <strong>creation_date<\/strong>, <strong>completion_date<\/strong>, and <strong>edited_date<\/strong> parameters.<\/p>\n<h5>Hiding and Showing Completed Tasks<\/h5>\n<p>Before v1.1, To Do Lists built with DHTMLX displayed both active and completed tasks. Now you get an opportunity to initialize your To Do List, where all completed tasks won\u2019t be seen on the page. Thus, end-users will be able to concentrate on relevant tasks. Technically, this new mode for displaying tasks is activated by enabling the taskHide attribute of the completed parameter in the <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/configs\/taskshape_config\/?_highlight=taskshape\/\" rel=\"noopener\" target=\"_blank\">taskShape<\/a><\/strong> property.<\/p>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\"><span class=\"kw1\">const<\/span> list <span class=\"sy0\">=<\/span> <span class=\"kw1\">new<\/span> ToDo<span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;#root&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp;tasks<span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp;taskShape<span class=\"sy0\">:<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;completed<span class=\"sy0\">:<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;behavior<span class=\"sy0\">:<\/span> <span class=\"st0\">&quot;manual&quot;<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;taskHide<span class=\"sy0\">:<\/span> <span class=\"kw2\">true<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp;<span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp;<span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dhtmlx.com\/blog\/wp-content\/uploads\/2022\/10\/hidingshowing-completed-tasks.gif\" alt=\"v1.1 - hiding and showing completed tasks\" width=\"800\" height=\"724\" class=\"aligncenter size-full wp-image-10615\" \/><a href=\"https:\/\/snippet.dhtmlx.com\/3vwlbwee?tag=todolist&#038;mode=wide\" rel=\"noopener\" target=\"_blank\">Check the sample ><\/a><\/p>\n<p>To make this mode valid for <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/haschildren_method\/\" rel=\"noopener\" target=\"_blank\">hasChildren()<\/a><\/strong> and <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/haschildren_method\/\" rel=\"noopener\" target=\"_blank\">getChildrenIds()<\/a><\/strong> methods of our JavaScript component, we added the new <strong>hideCompleted<\/strong> parameter for them.<\/p>\n<p>After the To Do List initialization, it is possible to show tasks in either of two modes and easily switch between them:<\/p>\n<ul>\n<li>by going to <strong>Completed tasks -> Show\/Hide<\/strong> in the Toolbar menu<\/li>\n<li>by using <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/hidecompletedtasks_method\/\" rel=\"noopener\" target=\"_blank\">hideCompletedTasks()<\/a><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/showcompletedtasks_method\/\" rel=\"noopener\" target=\"_blank\"><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/haschildren_method\/\" rel=\"noopener\" target=\"_blank\"><\/a><\/a><\/strong> and <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/methods\/showcompletedtasks_method\/\" rel=\"noopener\" target=\"_blank\">showCompletedTasks()<\/a><\/strong> methods:<\/li>\n<\/ul>\n<div class=\"codecolorer-container javascript default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"javascript codecolorer\">list.<span class=\"me1\">hideCompletedTasks<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"co1\">\/\/ or<\/span><br \/>\nlist.<span class=\"me1\">showCompletedTasks<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<h5>Other Changes and Improvements<\/h5>\n<p>In addition to new capabilities described above, we have to mention some other minor updates included in v1.1. For example, our team increased the number of available UI localization options. We also added new <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/events\/openmenu_event\/\" rel=\"noopener\" target=\"_blank\">open-menu<\/a><\/strong> and <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/events\/closemenu_event\/\" rel=\"noopener\" target=\"_blank\">close-menu<\/a><\/strong> events for managing the menu. <\/p>\n<p>Apart from that, two breaking changes took place in the <strong><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/api\/configs\/taskshape_config\/?_highlight=taskshape\/\" rel=\"noopener\" target=\"_blank\">taskShape<\/a><\/strong> property. Firstly, the <strong>selectable<\/strong> parameter of the property was <strong>renamed<\/strong> to completed. Secondly, this parameter received the new <strong>taskHide<\/strong> option. <\/p>\n<p>To sum everything up, visit &#8220;<a href=\"https:\/\/docs.dhtmlx.com\/todolist\/whats_new\/\" rel=\"noopener\" target=\"_blank\">What&#8217;s new<\/a>&#8221; sections of our documentation that one more time walk you through all new features delivered in v1.1.<\/p>\n<p>If you are excited to try the new DHTMLX To Do List in your own scenarios, just  download a <a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxTodo\/download.shtml\" rel=\"noopener\" target=\"_blank\">free 30-day trial version<\/a> and get down to it!<\/p>\n<p>Current DHTMLX clients can get access to the latest version of our JavaScript To Do List  in their <a href=\"https:\/\/dhtmlx.com\/clients\/\" rel=\"noopener\" target=\"_blank\">Client\u2019s Area<\/a>.<\/p>\n<p>We are looking forward to your feedback on this release in the comment section. <\/p>\n<h5>Related Materials:<\/h5>\n<ul>\n<li><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/category\/whats-new-and-migration\/\" rel=\"noopener\" target=\"_blank\">What&#8217;s new and migration<\/a><\/li>\n<li><a href=\"https:\/\/docs.dhtmlx.com\/todolist\/\" rel=\"noopener\" target=\"_blank\">DHTMLX To Do List documentation<\/a><\/li>\n<li><a href=\"https:\/\/snippet.dhtmlx.com\/3vwlbwee?tag=todolist&#038;mode=wide\" rel=\"noopener\" target=\"_blank\">DHTMLX To Do List examples<\/a><\/li>\n<li><a href=\"https:\/\/dhtmlx.com\/docs\/products\/dhtmlxTodo\/download.shtml\" rel=\"noopener\" target=\"_blank\">Free 30-day trial version<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Today, we are happy to present DHTMLX To Do List v1.1. Even though it falls under the category of a minor release, this update is a significant step forward &#8230;<\/p>\n","protected":false},"author":101014,"featured_media":10618,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[33,68],"class_list":["post-10609","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-releases","tag-all-posts","tag-to-do-list"],"_links":{"self":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/10609","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/users\/101014"}],"replies":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/comments?post=10609"}],"version-history":[{"count":10,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/10609\/revisions"}],"predecessor-version":[{"id":12725,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/posts\/10609\/revisions\/12725"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/media\/10618"}],"wp:attachment":[{"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/media?parent=10609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/categories?post=10609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dhtmlx.com\/blog\/wp-json\/wp\/v2\/tags?post=10609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}