You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great library, I definitely appreciate that this has been fully written in TypeScript.
I recently tried adding an actions column to my table but was unable because the row data must have the column name present. My workaround for this involves passing a null value to the column name. While this isn't a show-stopper by any means, I think it would be more appropriate to allow column fields to not be present.
I noticed that this line is where the check for the column name is present.
thrownewError(`Invalid row data, ${column.name} not found`);
Another solution I would like to propose would involve adding a excludedColumns field that would allow us to explicitly define which columns we would like to pass the check.
constsortDataInOrder=<TextendsDataType>(
data: T[],
columns: ColumnType<T>[],
excludedColumns: string[],
): T[] =>{returndata.map((row: any)=>{constnewRow: any={};columns.forEach(column=>{if(!(column.nameinrow)&&excludedColumns.indexOf(column.name)===-1){thrownewError(`Invalid row data, ${column.name} not found or was not defined in excludedColumns`);}newRow[column.name]=row[column.name];});returnnewRow;});};
I am more than happy to contribute a PR to add this functionality.
The text was updated successfully, but these errors were encountered:
Great library, I definitely appreciate that this has been fully written in TypeScript.
I recently tried adding an actions column to my table but was unable because the row data must have the column name present. My workaround for this involves passing a null value to the column name. While this isn't a show-stopper by any means, I think it would be more appropriate to allow column fields to not be present.
I noticed that this line is where the check for the column name is present.
thrownewError(`Invalid row data, ${column.name} not found`);
Another solution I would like to propose would involve adding a excludedColumns field that would allow us to explicitly define which columns we would like to pass the check.
constsortDataInOrder=<TextendsDataType>(
data: T[],
columns: ColumnType<T>[],
excludedColumns: string[],
): T[] =>{returndata.map((row: any)=>{constnewRow: any={};columns.forEach(column=>{if(!(column.nameinrow)&&excludedColumns.indexOf(column.name)===-1){thrownewError(`Invalid row data, ${column.name} not found or was not defined in excludedColumns`);}newRow[column.name]=row[column.name];});returnnewRow;});};
I am more than happy to contribute a PR to add this functionality.
Sorry for the late reply @austinbuckler. You are right, I would gladly accept a PR for this.
Great library, I definitely appreciate that this has been fully written in TypeScript.
I recently tried adding an actions column to my table but was unable because the row data must have the column name present. My workaround for this involves passing a
null
value to the column name. While this isn't a show-stopper by any means, I think it would be more appropriate to allow column fields to not be present.I noticed that this line is where the check for the column name is present.
react-final-table/src/hooks.tsx
Line 384 in 3bb860f
Another solution I would like to propose would involve adding a
excludedColumns
field that would allow us to explicitly define which columns we would like to pass the check.I am more than happy to contribute a PR to add this functionality.
The text was updated successfully, but these errors were encountered: