This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

how to sort the names listed ?
#1
Hi all,

How can we sort the names listed on the left side under the widget ?
For example in alphabetical order ?

It is very difficult for me to find the widget like this.

Is there a solution for this?

Thank you for your helps.

its ok on "Vis. Structure"..
But its not ok "visualization"

Attached Files Thumbnail(s)
       
Reply
#2
This will be fixed in the next firmware.

Meanwhile you can run this script to fix the sort order.
Code:
function sort(itype)
  local query = 'SELECT id, name FROM visfloors WHERE type=?'
  local items = db:getall(query, itype)
  
  table.sort(items, function(a, b)
    return a.name < b.name
  end)

  for i, item in ipairs(items) do
    db:update('visfloors', { sortorder = i }, { id = item.id })
  end
end

sort('widget')
sort('layout')
Reply
#3
(Yesterday, 07:13)admin Wrote: This will be fixed in the next firmware.

Meanwhile you can run this script to fix the sort order.
Code:
function sort(itype)
  local query = 'SELECT id, name FROM visfloors WHERE type=?'
  local items = db:getall(query, itype)
 
  table.sort(items, function(a, b)
    return a.name < b.name
  end)

  for i, item in ipairs(items) do
    db:update('visfloors', { sortorder = i }, { id = item.id })
  end
end

sort('widget')
sort('layout')

Its ok !

Thank you a lot.

Attached Files Thumbnail(s)
   
Reply


Forum Jump: