Skip to content

Beautiful Open-Source Form Builder

Select column pining (#861)

Chirag Chhatralaf4cc8827628d
diff --git a/client/components/open/forms/components/FormSubmissions.vue b/client/components/open/forms/components/FormSubmissions.vue
index da456d8dc..ccd73cb67 100644
--- a/client/components/open/forms/components/FormSubmissions.vue
+++ b/client/components/open/forms/components/FormSubmissions.vue
@@ -54,6 +54,7 @@ const props = defineProps({
const queryClient = useQueryClient()
const table = ref(null)
+// Replace all the recordStore logic with this:
const { paginatedList } = useFormSubmissions()
const {
submissions,
@@ -65,6 +66,7 @@ const {
setPage
} = paginatedList(computed(() => props.form?.id))
+// Replace existing event handlers:
const handleSearch = (searchTerm) => {
setSearch(searchTerm)
}
diff --git a/client/composables/components/tables/useTableState.js b/client/composables/components/tables/useTableState.js
index 2eebc5a48..9c4e6e22a 100644
--- a/client/composables/components/tables/useTableState.js
+++ b/client/composables/components/tables/useTableState.js
@@ -114,7 +114,7 @@ export function useTableState(form, withActions = false) {
const columnPinning = computed({
get() {
const prefs = columnPreferences.preferences.value
- const pinning = { left: [], right: ['actions'] }
+ const pinning = { left: ['select'], right: ['actions'] }
const configCols = columnConfigurations.value || []
configCols.forEach(col => {
const pref = prefs.columns[col.id] || {}
@@ -125,17 +125,19 @@ export function useTableState(form, withActions = false) {
return pinning
},
set(newPinning) {
- const { left = [] } = newPinning || {}
+ const { left = ['select'] } = newPinning || {}
const configCols = columnConfigurations.value || []
// First, clear pinning for all applicable columns (except actions)
configCols.forEach(col => {
- if (col.id !== 'actions') setColumnPreference(col.id, { pinned: false })
+ if (['actions', 'select'].includes(col.id)) return
+ setColumnPreference(col.id, { pinned: false })
})
// Apply new left pinning only
left.forEach(id => {
- if (id !== 'actions') setColumnPreference(id, { pinned: 'left' })
+ if (['actions','select'].includes(id)) return
+ setColumnPreference(id, { pinned: 'left' })
})
// Note: actions column pinning is handled automatically in the getter
}
@@ -380,7 +382,7 @@ export function useTableState(form, withActions = false) {
// Clear all existing pins
configCols.forEach(col => {
- if (col.id !== 'actions' && col.id !== columnId) {
+ if (['actions', 'select'].includes(col.id) && col.id !== columnId) {
setColumnPreference(col.id, { pinned: false })
}
})