0

is it possible to reorder/move widgets by given property on the dashboard ?

i am adding widgets dynamically to the dashboard by pushing data from a job to the erb file:

<div class="gridster">
  <ul>
   <% settings.servers.each do |data| %>
       <li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
         <div data-id="<%=data['webHost']%>" data-title="<%=data['name']%>" data-version="<%=data['Version']%>"  >
      </li>
   <% end %>
</div>
lielran
  • 189
  • 1
  • 9

1 Answers1

0

You can organize your widgets changing data-row and data-col.

If there are some property on your data that can be used to sort them the widgets, you could use it on data-row and data-col

Ex.:

<% settings.servers.each do |data| %>
   <li data-row="<%= data['row'] %>" data-col="<%= data['col'] %>" data-sizex="1" data-sizey="1">
     <div data-id="<%=data['webHost']%>" data-title="<%=data['name']%>" data-version="<%=data['Version']%>"  >
  </li>
<% end %>
cefigueiredo
  • 738
  • 3
  • 12
  • I tried to order it by row and col - it's seem that the widgets are override each other. (if this erb build 400 dynamically widgets , after using row and col i will end up with only one widget at x=1 y=1 location). – lielran Sep 19 '15 at 10:21
  • how would you order this set of widget by version for example ? – lielran Sep 19 '15 at 10:21