Find @devextreme/vdom Examples and Templates

Use this online @devextreme/vdom playground to view and fork @devextreme/vdom example apps and templates on CodeSandbox. Click any example below to run it instantly or find templates that can be used as a pre-built solution!

Drag & Drop for Hierarchical Data Structure - DevExtreme Tree View (forked)
Drag & Drop for Hierarchical Data Structure - DevExtreme Tree View (forked)This sample app demonstrates node drag and drop operations within DevExtreme TreeView when using a hierarchical data structure. You can reorder nodes within a single tree view or drag and drop nodes between two separate tree views. Use Sortable to implement the necessary drag and drop functionality within your web app. The following steps outline configuration requirements for our JavaScript TreeView: Allow users to reorder nodes Wrap the TreeView in a Sortable and enable the Sortable's allowReordering property. Allow users to change node hierarchy Enable the allowDropInsideItem property so that users can drop one node onto another. This adds it as the target node's child. If this property is disabled, users can only drop nodes between other nodes. Allow users to drag only tree view nodes To specify tree view nodes as drag targets, set the filter property to a class selector. Since all tree view nodes use the dx-treeview-node class, you can use this class selector as needed. Prevent a node from being moved into its child node When a user moves a parent node into its own child node, it breaks the hierarchy. To prevent this outcome, implement the onDragChange function and traverse up the node tree. If the target is a child of the dragged node, cancel the ability to drop the node. Reorder nodes in code Implement the onDragEnd function. In this function, you must gather information about nodes being moved. With this information, you can reorder the nodes in the data source (see the moveNode function), and reassign the data source to the TreeView's items property. Specify tree view identifiers (for drag and drop between multiple tree views only) Identifiers help distinguish between multiple tree views. Save them in the Sortable's data property. The tree views below include the following identifiers: "driveC" and "driveD". Combine tree views into one drag and drop group (for drag and drop between multiple tree views only) Set the Sortable's group property to the same value for all tree views. This allows users to move nodes between the tree views.
Record Paging - DevExtreme Data Grid
Record Paging - DevExtreme Data GridThe DataGrid splits records into multiple pages. This technique helps optimize control performance: the client only needs to load and render one page at a time. Users can use a scroll bar or a pager to navigate between pages. This demo shows how to enable and customize the pager. The pager is configured in the pager object and contains the following elements: Page navigator Enables page navigation. Page size selector Changes the page size. To display this element, enable the showPageSizeSelector property. You can also define the allowedPageSizes and specify the initial pageSize in the paging object. Page information Displays the current page number and total record count. To display page information, enable the showInfo property. You can also use the infoText property to customize the information text string. The pager supports full, compact, and adaptive (default) display modes. In compact mode, the pager hides page information and changes the appearance of other elements to use screen space more efficiently. In adaptive mode, the pager automatically chooses between the full and compact modes based on the DataGrid's width. Use the displayMode property to switch between modes. In this demo, you can use the drop-down Display Mode menu to switch between full and compact display modes. You can also use the checkboxes to hide or display different pager elements. Note that when the pager is in compact mode, navigation buttons are always visible but page information is hidden.
Find more examples or templates