File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,16 @@ def __init__(self, columns_or_json):
160
160
"Each column name of your dictionary must have "
161
161
"'data', 'order' and 'uid' as keys."
162
162
)
163
- # order columns in a list before putting inside the grid
163
+ # collect and sort all orders in case orders do not start
164
+ # at zero or there are jump discontinuities between them
165
+ all_orders = []
164
166
ordered_columns = []
165
- for order in range (len (columns_or_json ['cols' ])):
167
+ for column_name in columns_or_json ['cols' ].keys ():
168
+ all_orders .append (columns_or_json ['cols' ][column_name ]['order' ])
169
+ all_orders .sort ()
170
+
171
+ # put columns in order in a list
172
+ for order in all_orders :
166
173
for column_name in columns_or_json ['cols' ].keys ():
167
174
if columns_or_json ['cols' ][column_name ]['order' ] == order :
168
175
break
You can’t perform that action at this time.
0 commit comments