-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Draggable: Add Getting Started #8276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
arman-boyakhchyan
wants to merge
13
commits into
DevExpress:25_2
Choose a base branch
from
arman-boyakhchyan:draggable-getting-started-25-2
base: 25_2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0e94586
Draggable: Add Getting Started
arman-boyakhchyan efa9727
Add Simulator Container
arman-boyakhchyan 32d69c2
Update Adaptivity Following Feedback
arman-boyakhchyan e4263d6
Add DragMove and DragEnd Handlers
arman-boyakhchyan e2d89e3
Add Updates
arman-boyakhchyan 647dadb
Update Demo Container Code Following Example Improvements
arman-boyakhchyan 0927553
Add Padding
arman-boyakhchyan e5a3d2f
Update Following Feedback
arman-boyakhchyan 3a3e3f5
Add Style & Text Updates
arman-boyakhchyan e2b96ab
Finalize Topic
arman-boyakhchyan e887c39
Add group Definitions
arman-boyakhchyan e86a6c5
Minor Wording Update
arman-boyakhchyan 9bde672
Minor Rearrange
arman-boyakhchyan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| body { | ||
| padding: 0; | ||
| } | ||
|
|
||
| .demo-container { | ||
| display: flex; | ||
| flex-direction: column; | ||
| justify-content: center; | ||
| align-items: center; | ||
| padding: 0 40px; | ||
| height: 524px; | ||
| } | ||
|
|
||
| .boundary-text { | ||
| height: 16px; | ||
| line-height: 16px; | ||
| text-align: center; | ||
| vertical-align: middle; | ||
| padding-top: 17px; | ||
| padding-bottom: 17px; | ||
| color: var(--dx-color-icon) | ||
| } | ||
|
|
||
| .board { | ||
| background-color: light-dark(#F5F5F5, #141414); | ||
| outline: 1px dashed light-dark(#E0E0E0, #525252); | ||
| max-width: 1000px; | ||
| min-width: 320px; | ||
| width: 100%; | ||
| height: 500px; | ||
| display: grid; | ||
| grid-template-columns: repeat(4, 1fr); | ||
| align-content: start; | ||
| gap: 8px; | ||
| border-radius: 8px; | ||
| padding: 12px; | ||
| } | ||
|
|
||
| @media (width < 850px) { | ||
| .board { | ||
| grid-template-columns: repeat(3, 1fr); | ||
| } | ||
| } | ||
|
|
||
| @media (width < 650px) { | ||
| .board { | ||
| grid-template-columns: repeat(2, 1fr); | ||
| } | ||
| } | ||
|
|
||
| @media (width < 475px) { | ||
| .board { | ||
| grid-template-columns: 1fr; | ||
| } | ||
| } | ||
|
|
||
| .card { | ||
| z-index: 0; | ||
| max-width: 320px; | ||
| min-width: 180px; | ||
| width: 100%; | ||
| min-height: 84px; | ||
| max-height: 84px; | ||
| border-radius: 8px; | ||
| background-color: light-dark(#FFF, #292929); | ||
| display: flex; | ||
| box-shadow: 0 0 2px rgba(0 0 0 / 24%); | ||
| transition: box-shadow 0.1s ease-in-out; | ||
| } | ||
|
|
||
| .color-indicator { | ||
| margin: 8px; | ||
| height: 68px; | ||
| width: 4px; | ||
| border-radius: 4px; | ||
| } | ||
|
|
||
| .color-indicator.blue { | ||
| background-color: var(--dx-color-primary); | ||
| } | ||
|
|
||
| .color-indicator.green { | ||
| background-color: var(--dx-color-success); | ||
| } | ||
|
|
||
| .color-indicator.red { | ||
| background-color: var(--dx-color-danger); | ||
| } | ||
|
|
||
| .color-indicator.yellow { | ||
| background-color: var(--dx-color-warning); | ||
| } | ||
|
|
||
| .text-container { | ||
| margin-top: 8px; | ||
| margin-bottom: 8px; | ||
| margin-right: 8px; | ||
| height: 68px; | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| .body-text-box { | ||
| height: 40px; | ||
| } | ||
|
|
||
| .detail-text-box { | ||
| margin-top: auto; | ||
| color: light-dark(#707070, #999); | ||
| } | ||
|
|
||
| .card.dx-draggable-dragging { | ||
| box-shadow: 0 4px 8px rgba(0 0 0 / 28%); | ||
| } | ||
|
|
||
| .card.overlapped { | ||
| outline: 1px dashed var(--dx-color-primary); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| <div class="demo-container"> | ||
| <div class="boundary-text">Dragging Boundary</div> | ||
| <div class="board"> | ||
|
|
||
| <div id="note-1" class="card"> | ||
| <div class="color-indicator blue"></div> | ||
| <div class="text-container"> | ||
| <div class="body-text-box">Install New Router in Dev Room</div> | ||
| <div class="detail-text-box">Amelia Harper</div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div id="note-2" class="card"> | ||
| <div class="color-indicator green"></div> | ||
| <div class="text-container"> | ||
| <div class="body-text-box">👨💻 Launch New Website</div> | ||
| <div class="detail-text-box">Brett Wade</div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div id="note-3" class="card"> | ||
| <div class="color-indicator red"></div> | ||
| <div class="text-container"> | ||
| <div class="body-text-box">Prepare 2026 Marketing Plan</div> | ||
| <div class="detail-text-box">Robert Reagan</div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div id="note-4" class="card"> | ||
| <div class="color-indicator yellow"></div> | ||
| <div class="text-container"> | ||
| <div class="body-text-box">🖥️ Approve Personal Computer Upgrade Plan</div> | ||
| <div class="detail-text-box">Bart Arnaz</div> | ||
| </div> | ||
| </div> | ||
|
|
||
| </div> | ||
| <div class="boundary-text">Dragging Boundary</div> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| $(() => { | ||
| let z = 1; | ||
|
|
||
| $("#note-1").dxDraggable({ | ||
| onDragStart: handleDragStart, | ||
| boundary: ".board", | ||
| group: "cards", | ||
| }).on({ | ||
| "click": handleClick, | ||
| "dxdragenter": handleDragEnter, | ||
| "dxdragleave": handleDragStop, | ||
| "dxdrop": handleDragStop, | ||
| }); | ||
|
|
||
| $("#note-2").dxDraggable({ | ||
| onDragStart: handleDragStart, | ||
| group: "cards", | ||
| boundary: ".board", | ||
| }).on({ | ||
| "click": handleClick, | ||
| "dxdragenter": handleDragEnter, | ||
| "dxdragleave": handleDragStop, | ||
| "dxdrop": handleDragStop, | ||
| }); | ||
|
|
||
| $("#note-3").dxDraggable({ | ||
| onDragStart: handleDragStart, | ||
| group: "cards", | ||
| boundary: ".board", | ||
| }).on({ | ||
| "click": handleClick, | ||
| "dxdragenter": handleDragEnter, | ||
| "dxdragleave": handleDragStop, | ||
| "dxdrop": handleDragStop, | ||
| }); | ||
|
|
||
| $("#note-4").dxDraggable({ | ||
| onDragStart: handleDragStart, | ||
| boundary: ".board", | ||
| group: "cards", | ||
| }).on({ | ||
| "click": handleClick, | ||
| "dxdragenter": handleDragEnter, | ||
| "dxdragleave": handleDragStop, | ||
| "dxdrop": handleDragStop, | ||
| }); | ||
|
|
||
| function changeZIndex(el) { | ||
| el.css("z-index", z); | ||
| z++; | ||
| } | ||
|
|
||
| function handleClick(e) { | ||
| changeZIndex($(e.currentTarget)); | ||
| } | ||
|
|
||
| function handleDragStart(e) { | ||
| changeZIndex($(e.element[0])); | ||
| } | ||
|
|
||
| function handleDragEnter(e) { | ||
| e.target.classList.add('overlapped'); | ||
| } | ||
|
|
||
| function handleDragStop(e) { | ||
| e.target.classList.remove('overlapped'); | ||
| } | ||
| }); |
15 changes: 15 additions & 0 deletions
15
...raggable/05 Getting Started with Draggable/00 Getting Started with Draggable.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #include tutorials-intro-installationnote | ||
|
|
||
| This tutorial guides you through the following steps: | ||
|
|
||
| - Add a Draggable to a page. | ||
| - Configure Draggable options. | ||
| - Handle events (specific to Draggable, as well as common events). | ||
|
|
||
| <div class="simulator-desktop-container" data-view="/Content/Applications/25_2/GettingStartedWith/Draggable/index.html, /Content/Applications/25_2/GettingStartedWith/Draggable/index.js, /Content/Applications/25_2/GettingStartedWith/Draggable/index.css" style="border-radius: 16px; height: 524px;"></div> | ||
|
|
||
| Each section in this tutorial covers a single configuration step. You can find the complete source code in the following GitHub repository: | ||
|
|
||
| #include btn-open-github with { | ||
| href: "https://github.com/DevExpress-Examples/devextreme-getting-started-with-draggable" | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.