示例#1
0
class ObjectCheckboxColumn(ObjectTableColumn):
    def __init__(self, app, name, attr, selection):
        super(ObjectCheckboxColumn, self).__init__(app, name, attr)

        self.selection = selection

        self.header = CheckboxColumnHeader(app, "header")
        self.replace_child(self.header)

        self.cell = CheckboxColumnCell(app, "cell", selection)
        self.replace_child(self.cell)

        self.cell.input = ObjectCheckboxColumnInput(app, "input", selection)
        self.cell.replace_child(self.cell.input)

        self.sortable = False
        self.width = "25px;"

    def render_cell_value(self, session, record):
        try:
            return record[self.field.index]
        except IndexError:
            return 0
示例#2
0
    def __init__(self, app, name, attr, selection):
        super(ObjectCheckboxColumn, self).__init__(app, name, attr)

        self.selection = selection

        self.header = CheckboxColumnHeader(app, "header")
        self.replace_child(self.header)

        self.cell = CheckboxColumnCell(app, "cell", selection)
        self.replace_child(self.cell)

        self.cell.input = ObjectCheckboxColumnInput(app, "input", selection)
        self.cell.replace_child(self.cell.input)

        self.sortable = False
        self.width = "25px;"