@@ -23,7 +23,7 @@ <h1>Two grids demo</h1>
2323
2424 < div class ="row ">
2525 < div class ="col-md-8 ">
26- <!-- NOTE: add .grid-stack-item for acceptWidgets:true, but not needed for function which handles .sidebar-item -->
26+ <!-- NOTE: add .grid-stack-item for acceptWidgets:true, but not needed for function which handles .sidebar-item (anything) -->
2727 < div class ="sidebar ">
2828 <!-- will size to match content. Also see sidebarContent -->
2929 < div class ="sidebar-item "> Drag me</ div >
@@ -73,7 +73,7 @@ <h1>Two grids demo</h1>
7373 ] ;
7474 items . forEach ( ( item , i ) => item . content = item . content || String ( i ) ) ;
7575
76- // sidebar content to create when we get dropped, instead of inserting the clone version
76+ // sidebar content (just 2, rest is other behavior) to create when we get dropped, instead of inserting the clone version
7777 let sidebarContent = [
7878 { content : 'dropped' } ,
7979 { content : 'max=3' , w :2 , h :1 , maxW : 3 } ,
@@ -85,9 +85,10 @@ <h1>Two grids demo</h1>
8585 cellHeight : 70 ,
8686 float : true ,
8787 removable : '.trash' , // true or drag-out delete class
88+ /** accepts everything fcn, not just .grid-stack-item (true case) but can also be: true | false | '.someClass' value */
89+ acceptWidgets : function ( el ) { return true } ,
8890 children : items ,
8991 // itemClass: 'with-lines', // test a custom additional class #2110
90- acceptWidgets : function ( el ) { return true } // function example, but can also be: true | false | '.someClass' value
9192 } ;
9293 let grids = GridStack . initAll ( options ) ;
9394 grids [ 1 ] . float ( false ) ;
0 commit comments