mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
Add columnlist:SetColumnOrder
This commit is contained in:
parent
2ef6d6b3b5
commit
b0b6bad966
@ -961,3 +961,23 @@ function newobject:SizeColumnToData(columnid)
|
|||||||
return self
|
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