DevExtreme v24.1 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

JavaScript/jQuery List - Item Deletion UI

The JavaScript List displays a collection of items as a scrollable list. To create a list, pass an array of items to the dataSource property.

To allow users to delete items, set the allowItemDeleting property to true. Use the "Allow deletion" checkbox under the JavaScript List to toggle this property.

DevExtreme Accessibility Compliance
DevExtreme component libraries meet a variety of WCAG and Section 508 compliance standards. To assess this demo’s accessibility level, click the Run AXE® Validation button to launch the AXE® web accessibility evaluation tool.
All trademarks or registered trademarks are property of their respective owners. AXE® Terms of Use
The overall accessibility level of your application depends on the List features used.
Backend API
$(() => { const listWidget = $('#simpleList').dxList({ dataSource: tasks, height: 400, allowItemDeleting: false, itemDeleteMode: 'toggle', }).dxList('instance'); $('#allowDeletion').dxCheckBox({ value: false, text: 'Allow deletion', onValueChanged(data) { listWidget.option('allowItemDeleting', data.value); itemDeleteModeChooser.option('disabled', !data.value); }, }); const itemDeleteModeChooser = $('#itemDeleteMode').dxSelectBox({ disabled: true, inputAttr: { 'aria-label': 'Delete Mode' }, dataSource: ['static', 'toggle', 'slideButton', 'slideItem', 'swipe', 'context'], value: 'toggle', onValueChanged(data) { listWidget.option('itemDeleteMode', data.value); }, }).dxSelectBox('instance'); });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/24.1.7/css/dx.light.css" /> <script src="js/dx.all.js"></script> <script src="data.js"></script> <link rel="stylesheet" type="text/css" href="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="list-api-demo"> <div class="widget-container"> <div id="simpleList"></div> </div> <div class="options"> <div class="caption">Options</div> <div class="option"> <div id="allowDeletion"></div> </div> <div class="option"> <span>Item delete mode</span> <div id="itemDeleteMode"></div> </div> </div> </div> </div> </body> </html>
.options { margin-top: 20px; padding: 20px; background: rgba(191, 191, 191, 0.15); } .options .caption { font-size: 18px; font-weight: 500; } .option { margin-top: 10px; } .option > span { margin-right: 10px; } .option > .dx-selectbox { display: inline-block; vertical-align: middle; max-width: 350px; width: 100%; }
const tasks = ['Prepare 2016 Financial', 'Prepare 2016 Marketing Plan', 'Update Personnel Files', 'Review Health Insurance Options Under the Affordable Care Act', 'New Brochures', '2016 Brochure Designs', 'Brochure Design Review', 'Website Re-Design Plan', 'Rollout of New Website and Marketing Brochures', 'Update Sales Strategy Documents', 'Create 2012 Sales Report', 'Direct vs Online Sales Comparison Report', 'Review 2012 Sales Report and Approve 2016 Plans', 'Deliver R&D Plans for 2016', 'Create 2016 R&D Plans', '2016 QA Strategy Report', '2016 Training Events', 'Approve Hiring of John Jeffers', 'Non-Compete Agreements', 'Update NDA Agreement', 'Update Employee Files with New NDA', 'Sign Updated NDA', 'Submit Questions Regarding New NDA', 'Submit Signed NDA', 'Update Revenue Projections', 'Review Revenue Projections', 'Comment on Revenue Projections', 'Provide New Health Insurance Docs', 'Review Changes to Health Insurance Coverage', 'Scan Health Insurance Forms', 'Sign Health Insurance Forms', 'Follow up with West Coast Stores', 'Follow up with East Coast Stores', 'Send Email to Customers about Recall', 'Submit Refund Report for 2016 Recall', 'Give Final Approval for Refunds', 'Prepare Product Recall Report', 'Review Product Recall Report by Engineering Team', 'Create Training Course for New TVs', 'Review Training Course for any Omissions', 'Review Overtime Report', 'Submit Overtime Request Forms', 'Overtime Approval Guidelines', 'Refund Request Template', 'Recall Rebate Form', 'Create Report on Customer Feedback', 'Review Customer Feedback Report', 'Customer Feedback Report Analysis', 'Prepare Shipping Cost Analysis Report', 'Provide Feedback on Shippers', 'Select Preferred Shipper', 'Complete Shipper Selection Form', 'Upgrade Server Hardware', 'Upgrade Personal Computers', 'Approve Personal Computer Upgrade Plan', 'Decide on Mobile Devices to Use in the Field', 'Upgrade Apps to Windows RT or stay with WinForms', 'Estimate Time Required to Touch-Enable Apps', 'Report on Tranistion to Touch-Based Apps', 'Try New Touch-Enabled WinForms Apps', 'Rollout New Touch-Enabled WinForms Apps', 'Site Up-Time Report', 'Review Site Up-Time Report', 'Review Online Sales Report', 'Determine New Online Marketing Strategy', 'New Online Marketing Strategy', 'Approve New Online Marketing Strategy', 'Submit New Website Design', 'Create Icons for Website', 'Review PSDs for New Website', 'Create New Shopping Cart', 'Create New Product Pages', 'Review New Product Pages', 'Approve Website Launch', 'Launch New Website', 'Update Customer Shipping Profiles', 'Create New Shipping Return Labels', 'Get Design for Shipping Return Labels', 'PSD needed for Shipping Return Labels', 'Request Bandwidth Increase from ISP', 'Submit D&B Number to ISP for Credit Approval', 'Contact ISP and Discuss Payment Options', 'Prepare Year-End Support Summary Report', 'Analyze Support Traffic for 2016', 'Review New Training Material', 'Distribute Training Material to Support Staff', 'Training Material Distribution Schedule', 'Provide New Artwork to Support Team', 'Publish New Art on the Server', 'Replace Old Artwork with New Artwork', 'Ship New Brochures to Field', 'Ship Brochures to Todd Hoffman', 'Update Server with Service Packs', 'Install New Database', 'Approve Overtime for HR', 'Review New HDMI Specification', 'Approval on Converting to New HDMI Specification', 'Create New Spike for Automation Server', 'Report on Retail Sales Strategy for 2014', 'Code Review - New Automation Server', 'Feedback on New Training Course', 'Send Monthly Invoices from Shippers', 'Schedule Meeting with Sales Team', 'Confirm Availability for Sales Meeting', 'Reschedule Sales Team Meeting', 'Send 2 Remotes for Giveaways', 'Ship 2 Remotes Priority to Clark Morgan', 'Discuss Product Giveaways with Management', 'Follow Up Email with Recent Online Purchasers', 'Replace Desktops on the 3rd Floor', 'Update Database with New Leads', 'Mail New Leads for Follow Up', 'Send Territory Sales Breakdown', 'Territory Sales Breakdown Report', 'Return Merchandise Report', 'Report on the State of Engineering Dept', 'Staff Productivity Report', 'Review HR Budget Company Wide', 'Sales Dept Budget Request Report', 'Support Dept Budget Report', 'IT Dept Budget Request Report', 'Engineering Dept Budget Request Report', '1Q Travel Spend Report', 'Approve Benefits Upgrade Package', 'Final Budget Review', 'State of Operations Report', 'Online Sales Report', 'Reprint All Shipping Labels', 'Shipping Label Artwork', 'Specs for New Shipping Label', 'Move Packaging Materials to New Warehouse', 'Move Inventory to New Warehouse', 'Take Forklift to Service Center', 'Approve Rental of Forklift', 'Give Final Approval to Rent Forklift', 'Approve Overtime Pay', 'Approve Vacation Request', 'Approve Salary Increase Request', 'Review Complaint Reports', 'Review Website Complaint Reports', 'Test New Automation App', 'Fix Synchronization Issues', 'Free Up Space for New Application Set', 'Install New Router in Dev Room', 'Update Your Profile on Website', 'Schedule Conf Call with SuperMart', 'Support Team Evaluation Report', 'Create New Installer for Company Wide App Deployment', 'Pickup Packages from the Warehouse', 'Sumit Travel Expenses for Recent Trip', 'Make Travel Arrangements for Sales Trip to San Francisco', 'Book Flights to San Fran for Sales Trip', 'Collect Customer Reviews for Website', 'Submit New W4 for Updated Exemptions', 'Get New Frequent Flier Account', 'Review New Customer Follow Up Plan', 'Submit Customer Follow Up Plan Feedback', 'Review Issue Report and Provide Workarounds', 'Contact Customers for Video Interviews', 'Resubmit Request for Expense Reimbursement', 'Approve Vacation Request Form', 'Email Test Report on New Products', 'Send Receipts for all Flights Last Month'];

The "Deletion UI type" drop-down menu under the JavaScript List allows you to switch between the different deletion behaviors described below. Menu items correspond to itemDeleteMode property values.

  • "static" (default for desktops)
    Click an X button next to a list item to delete it.

  • "toggle"
    Click a minus icon next to a list item to display the Delete button.

  • "slideButton"
    Swipe left or right to show the Delete button next to the list item. The content of the list item does not move.

  • "slideItem" (default for iOS)
    Slide list items left. The content of the list item shifts to make space for the Delete button.

  • "swipe" (default for Android)
    Swipe items to delete them.

  • "context"
    Right-click or touch and hold the list item to call a context menu that contains the Delete option.

To get started with the DevExtreme JavaScript List component, refer to the following tutorial for step-by-step instructions: Getting Started with JavaScript List.