Browse Source

Merge pull request #5475 from nocodb/fix/mssql-checkbox

fix(nc-gui): checkbox in mssql
pull/5497/head
Raju Udava 2 years ago committed by GitHub
parent
commit
e88061c843
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      packages/nc-gui/components/cell/Checkbox.vue

11
packages/nc-gui/components/cell/Checkbox.vue

@ -8,6 +8,7 @@ import {
inject,
parseProp,
useSelectedCellKeyupListener,
useProject,
} from '#imports'
interface Props {
@ -26,10 +27,7 @@ const emits = defineEmits<Emits>()
const active = inject(ActiveCellInj, ref(false))
let vModel = $computed<boolean>({
get: () => !!props.modelValue && props.modelValue !== '0' && props.modelValue !== 0,
set: (val: boolean) => emits('update:modelValue', val),
})
const { isMssql } = useProject()
const column = inject(ColumnInj)
@ -48,6 +46,11 @@ const checkboxMeta = $computed(() => {
}
})
let vModel = $computed<boolean | number>({
get: () => !!props.modelValue && props.modelValue !== '0' && props.modelValue !== 0,
set: (val: any) => emits('update:modelValue', isMssql(column?.value?.base_id) ? +val : val),
})
function onClick(force?: boolean, event?: MouseEvent) {
if (
(event?.target as HTMLElement)?.classList?.contains('nc-checkbox') ||

Loading…
Cancel
Save