$(function() {
$('#modal').on('click',function(){
var myModal = new bootstrap.Modal(document.getElementById('CustomEtq'))
myModal.show();
})
//min-heigh pra introduzir o menor tamanho selecionado.
function customClone(event) {
const el = event.target.cloneNode(true);
el.setAttribute('gs-id', 'foo');
return el;
}
})
let options = {
column: 12,
minRow: 1, // don't collapse when empty
cellHeight: 70,
disableOneColumnMode: true,
float: true,
removable: '.trash', // true or drag-out delete class
// itemClass: 'with-lines', // test a custom additional class #2110
acceptWidgets: function(el) { return true } // function example, but can also be: true | false | '.someClass' value
};
let grids = GridStack.initAll(options);
grids[1].float(false);
// new 4.x static method instead of setting up options on every grid (never been per grid really)
GridStack.setupDragIn('.sidebar .grid-stack-item', { appendTo: 'body', helper: myClone });
// GridStack.setupDragIn(); // second call will now work (cache last values)
let items = [
{x: 0, y: 0, w: 2, h: 2},
{x: 3, y: 1, h: 2},
{x: 4, y: 1},
{x: 2, y: 3, w: 3, maxW: 3, id: 'special', content: 'has maxW=3'},
{x: 2, y: 5}
];
grids.forEach(function (grid, i) {
addEvents(grid, i);
grid.load(items);
});
// decide what the dropped item will be - for now just a clone but can be anything
function myClone(event) {
const el = event.target.cloneNode(true);
el.setAttribute('gs-id', 'foo'); // TEST why clone element is not used directly on drop #2231
return el;
}
function toggleFloat(button, i) {
grids[i].float(! grids[i].getFloat());
button.innerHTML = 'float: ' + grids[i].getFloat();
}
function compact(i) {
grids[i].compact();
}
function addEvents(grid, id) {
let g = (id !== undefined ? 'grid' + id + ' ' : '');
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.