Gridstack.js is a vanilla JavaScript widget/grid layout plugin inspired by Gridster that allows you to dynamically and responsively rearrange grid items through drag and drop.
Note: The library now works as a Vanilla JavaScript plugin. You can also download the jQuery Version here for jQuery projects.
More features:
Download Space Drop: Better Drag & Drop for macOS 10.10 or later and enjoy it on your Mac. Space Drop is an essential utility for Mac users who want to seriously speed up their workflow. Featured by Apple in 'New Apps we Love'! Hi there - I appreciate you for taking a look at our post! What we're looking for: - PASSIONATE Web Designers to design/build 10 Themes/Templates for our new Drag. The most advanced frontend drag & drop website builder. Create high-end, pixel perfect websites at record speeds. Any theme, any page, any design. 1.7.6 – 2017-09-26. Tweak: Changed video lightbox width for tablet to 100%. Added margin top property in.elementor-inner class for better handling with fixed headers; 1.2.4 – 2017-02-28. My goal is to have a QTableWidget in which the user can drag/drop rows internally. That is, the user can drag and drop one entire row, moving it up or down in the table to a different location in between two other rows. @mrjj The empty space you see in the attached image is basically the layout which all PlayerControls are added to, held by a QGroupBox titled 'Players:'. That being said, do I have to configure my drag and drop functionality on the QGroupBox rather then the MultiTrackPlayer?
- Also supports touch events.
- Resizable grid items.
- Supports nested grid items.
- Compatible with Bootstrap 3/4 framework.
- No jQuery required (v2.0.0+)
View more:
Table Of Contents:
Basic Usage (Vanilla JS Version):
1. Install & Download the package.
![Space drop: better drag & drop 1 7 64 Space drop: better drag & drop 1 7 64](https://485758.smushcdn.com/622655/wp-content/uploads/2020/10/drag-and-drop-wordpress-themes-150x150.jpg?lossy=1&strip=1&webp=1)
2. Include the necessary JavaScript and CSS files on the page.
3. Insert optional grid items to the Grid Stack container and pass the options via
data-option
attributes as follows:
4. Initialize the plugin and done.
5. All default options.
6. API methods.
7. Event handlers.
Basic Usage (jQuery Version):
1. Include jQuery library and other required resources in the the document.
- jQuery
- jQuery UI
- jQuery UI Touch Punch: for touch support (OPTIONAL)
- gridstack.poly.js: for IE and older browsers (OPTIONAL)
2. Include the jQuery Gridstack.js plugin and other required resources at the end of the document.
3. Create a sample draggable grid layout as follows.
data-gs-animate
: turns animation on (for grid)data-gs-column
: amount of columns (for grid)data-gs-max-row
: maximum rows amount, defaults to 0 (for grid)data-gs-current-height
: current rows amount (for grid)data-gs-id
: unique ID (for item)data-gs-x
,data-gs-y
: element position (for item)data-gs-width
,data-gs-height
: element size (for item)data-gs-max-width
,data-gs-min-width
,data-gs-max-height
,t remove item from another grid
fixed: init() clones passed options so second doesn't affect first one
fixed: addWidget() ignores data attributes
v1.1.1 (2020-04-13)
jQuery was removed from the API and dependencies (initialize differently, and methods take/return GridStack or HTMLElement instead of JQuery).
Updated Doc accordingly.
v0.6.4 (2020-02-18)
optimized change callback to save original x,y,w,h values and only call those that changed
more bugs fixed
This awesome jQuery plugin is developed by gridstack. For more Advanced Usages, please check the demo page or visit the official website.
Prev: jQuery Plugin For Animated Fixed Elements - Butterfly
Next: Cross Browser jQuery One Page Navigation / Smooth Scrolling Plugin - Full Scroll
Overview
There have been a number of drag sorting solutions. Here is a better one.
When a client asked me to implement Ray Cologon / Nightwing's portal sorting solution into his solution I was not happy with the appearance and UX. I rebuilt my own solution from scratch using the original data set and scheme. Here is how I solved this problem.
Better Drag Sort Features
Space Drop: Better Drag & Drop 1 7 62x39
- Single Container field per sort portal per table
- Single abstracted modular script
- Sexy drop target UI indication
- Fully Separation Model Compatible
- One additional container field
- One script for all sorts
How it Works
The trick to container drag sorting is identifying the Origin and destination portal rows. Once you know these you can deserialize your sort order and update the sort order. Some solutions use ID's in the container and then check the destination container for the source ID. This solution instantiates $$Vars in the destination container that are then visible to the sort script.
Another challenge is abstracting the sorting script so that it is context insensitive and can be used throughout the whole application. Since the configuration is totally done in the container calc, there is no need to make any changes in the universal sorting script.
Having an elegant target indicator. All solutions I have seen have either multiple container rows or single rows and do not clearly indicate where the dragged row will actually go. By using some custom CSS for the Drop Target attribute, we can have a clean line so there is no ambiguity.
The final challenge is to prevent a user from dropping the drag into a text field and subsequently erasing the text fields contents. This is handled by not dragging text and instead dragging a transparent blank image. FMP does not allow images to be dropped in text fields.
The demo files are well documented. Delfs' Engineering is also able to help you integrate custom drag sorting into your solution.
Demo Files
V1.1
- Adds support for portals that have `allow create related records`
- Adds support for List View, Thanks to Joshua Willing Halpern
- Update but replaceing the Auto-Enter Container Calcs and copy and paste script contents.
Final Thoughts
I have started working on a V2 of this demo. This will support multiple selections for the drag source. (Shift or option key while clicking) Once selected they can all be dragged into the slot of the destination. There may be some artifacts in V1 from before I forked the project.
@mrdelfs
Buy me a pint ! I attend most FM conferences, see you there!
![Drag Drag](https://blog.hubspot.com/hs-fs/hubfs/Drag%20and%20Drop%20Page%20Builder%20Website%20Blog%20Post-1.png?width=600&name=Drag%20and%20Drop%20Page%20Builder%20Website%20Blog%20Post-1.png)
Space Drop: Better Drag & Drop 1 7 60
FMP V16 Breaks the drop script trigger for png files. This, I am told, is fixed with the latest release. ~cd
V2 Wish List
- Ability to work with List view and portal records - Dan Smith
- Multiple source selection (drag multiple records - Doug Gardner
- Add Ability to work with Allow Created Records (see comments) - David Zakary
- Support for inter-portal dragging (and order inserting) - Mateusz Poradecki
- FM Go Support (and WD) - Daniel
NOTE: If your comment warrants a reply, use the site contact page so we have your email.
51 Comments