ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.03k stars 1.2k forks source link

Gridster seems to add "gs_w" class to my <li> elements #217

Closed markrogers123 closed 11 years ago

markrogers123 commented 11 years ago

Hi, I am using Gridster to ceate a darg - drop - resizable widget grid.

Gridster seems to add "position: relative" style to my ul elements and "gs_w" class to my li elements, making all the li elements appear on the same line.

My code is:

        <ul>
          <li>Browser text<li>
          <li>Business information charts</li>
          <li>External content</li>
        </ul>

Generated code is:

        <ul style="position: relative;">
          <li class="gs_w">Browser text</li><li class="gs_w">
          </li><li class="gs_w">Business information charts</li>
          <li class="gs_w">External content</li>
        </ul>

I would be grateful for any advice

ollyg commented 11 years ago

I think you must always add data-row="1" data-col="1" data-sizex="1" data-sizey="1" to the list items.

markrogers123 commented 11 years ago

Sorry, I wasn't clear.

These list items are not the ones that I want to drag / drop / resize. They are internal within the dragable widget. I should have included a larger code snippet:

  <li class="layout_block style-back-default style-border-default" data-id="2" data-row="1" data-col="2" data-sizex="3" data-sizey="3" >
    <div class="info">
      <span class="block_name">
        <h2>Some header</h2>
        <p>Some text</p>
        <ul>
          <li>Browser text<li>
          <li>Business information charts</li>
          <li>External content</li>
        </ul>
      </span>
    </div>    
  </li>

How do I stop Gridster from altering these internal list items?

ollyg commented 11 years ago

Ah, see the widget_selector option, I think.

markrogers123 commented 11 years ago

Many thanks. It's obvious now you have pointed me in the right direction. Mark

Jalmed commented 9 years ago

I 've the same issue. How does you solve this problem ? Many thanks for advice.