Add append()
and replace()
methods for core Grid class
This commit is contained in:
parent
1e8c9f709b
commit
97c5e97ccb
|
@ -128,12 +128,19 @@ class Grid(object):
|
|||
if key in self.columns:
|
||||
self.columns.remove(key)
|
||||
|
||||
def append(self, field):
|
||||
self.columns.append(field)
|
||||
|
||||
def insert_before(self, field, newfield):
|
||||
self.columns.insert_before(field, newfield)
|
||||
|
||||
def insert_after(self, field, newfield):
|
||||
self.columns.insert_after(field, newfield)
|
||||
|
||||
def replace(self, oldfield, newfield):
|
||||
self.insert_after(oldfield, newfield)
|
||||
self.hide_column(oldfield)
|
||||
|
||||
def set_joiner(self, key, joiner):
|
||||
if joiner is None:
|
||||
self.joiners.pop(key, None)
|
||||
|
|
Loading…
Reference in a new issue