mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +00:00
Add columnlist:SetColumnOrder
This commit is contained in:
parent
2ef6d6b3b5
commit
b0b6bad966
@ -960,4 +960,24 @@ function newobject:SizeColumnToData(columnid)
|
||||
self:SetColumnWidth(columnid, largest)
|
||||
return self
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
--[[---------------------------------------------------------
|
||||
- func: SetColumnOrder(curid, newid)
|
||||
- desc: sets the order of the specified column
|
||||
--]]---------------------------------------------------------
|
||||
function newobject:SetColumnOrder(curid, newid)
|
||||
|
||||
local column = self.children[curid]
|
||||
local totalcolumns = #self.children
|
||||
|
||||
if column and totalcolumns > 1 and newid <= totalcolumns and newid >= 1 then
|
||||
column:Remove()
|
||||
table.insert(self.children, newid, column)
|
||||
self:PositionColumns()
|
||||
end
|
||||
|
||||
return self
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user