Add columnlist:SetColumnOrder

This commit is contained in:
Kenny Shields 2014-09-28 15:27:51 -04:00
parent 2ef6d6b3b5
commit b0b6bad966

View File

@ -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