Sets the table column count. Args: count (int): column of rows
(self, count)
| 3092 | self.remove_child(self.children[str(i)]) |
| 3093 | |
| 3094 | def set_column_count(self, count): |
| 3095 | """Sets the table column count. |
| 3096 | |
| 3097 | Args: |
| 3098 | count (int): column of rows |
| 3099 | """ |
| 3100 | current_row_count = self.row_count |
| 3101 | current_column_count = self.column_count |
| 3102 | if count > current_column_count: |
| 3103 | cl = TableEditableItem if self._editable else TableItem |
| 3104 | for r_key in self.children.keys(): |
| 3105 | row = self.children[r_key] |
| 3106 | for i in range(current_column_count, count): |
| 3107 | row.append(cl(), str(i)) |
| 3108 | if self._editable: |
| 3109 | row.children[str(i)].onchange.connect( |
| 3110 | self.on_item_changed, int(r_key), int(i)) |
| 3111 | self._update_first_row() |
| 3112 | elif count < current_column_count: |
| 3113 | for row in self.children.values(): |
| 3114 | for i in range(count, current_column_count): |
| 3115 | row.remove_child(row.children[str(i)]) |
| 3116 | self.__column_count = count |
| 3117 | |
| 3118 | @decorate_set_on_listener("(self, emitter, item, new_value, row, column)") |
| 3119 | @decorate_event |
no test coverage detected