|
|
@ -78,7 +78,7 @@ export const extractMultiOrSingleSelectProps = (colData: []) => { |
|
|
|
} |
|
|
|
} |
|
|
|
// set dtxp here so that users can have the options even they switch the type from other types to MultiSelect
|
|
|
|
// set dtxp here so that users can have the options even they switch the type from other types to MultiSelect
|
|
|
|
// once it's set, dtxp needs to be reset if the final column type is not MultiSelect
|
|
|
|
// once it's set, dtxp needs to be reset if the final column type is not MultiSelect
|
|
|
|
colProps.dtxp = `'${uniqueVals.join("','")}'` |
|
|
|
colProps.dtxp = `${uniqueVals.map((v) => `'${v.replace(/'/gi, "''")}'`).join(',')}` |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const uniqueVals = [...new Set(colData.map((v: any) => v.toString().trim().toLowerCase()))] |
|
|
|
const uniqueVals = [...new Set(colData.map((v: any) => v.toString().trim().toLowerCase()))] |
|
|
@ -96,7 +96,7 @@ export const extractMultiOrSingleSelectProps = (colData: []) => { |
|
|
|
} |
|
|
|
} |
|
|
|
// set dtxp here so that users can have the options even they switch the type from other types to SingleSelect
|
|
|
|
// set dtxp here so that users can have the options even they switch the type from other types to SingleSelect
|
|
|
|
// once it's set, dtxp needs to be reset if the final column type is not SingleSelect
|
|
|
|
// once it's set, dtxp needs to be reset if the final column type is not SingleSelect
|
|
|
|
colProps.dtxp = `'${uniqueVals.join("','")}'` |
|
|
|
colProps.dtxp = `${uniqueVals.map((v) => `'${v.replace(/'/gi, "''")}'`).join(',')}` |
|
|
|
} |
|
|
|
} |
|
|
|
return colProps |
|
|
|
return colProps |
|
|
|
} |
|
|
|
} |
|
|
|