How do I prevent re-ordering fields in the GRID?

Where should I edit the source to prevent the re-ordering of the view? Would appreciate your help

Thanks

Hi @computersrmyfriends, if I understand correctly, you want to disable the re-ordering of the views in a table. Specifically this part in the screenshot below.

If so, then you need to look at the web-frontend/modules/database/components/view/ViewsContext.vue file in the codebase. If you scroll to line ~30, you’ll see the following snippet.

          <ViewsContextItem
            v-for="view in viewsByOwnership(views, type.getType())"
            :ref="'view-' + view.id"
            :key="view.id"
            v-sortable="{
              enabled:
                !readOnly &&
                $hasPermission(
                  'database.table.order_views',
                  table,
                  database.workspace.id
                ),
              id: view.id,
              update: createOrderCall(view.ownership_type),
              marginTop: -1.5,
            }"
            :database="database"
            :view="view"
            :table="table"
            :read-only="readOnly"
            @selected="selectedView"
          ></ViewsContextItem>

If you remove the v-sortable part, it should disable the re-ordering of the views.

          <ViewsContextItem
            v-for="view in viewsByOwnership(views, type.getType())"
            :ref="'view-' + view.id"
            :key="view.id"
            :database="database"
            :view="view"
            :table="table"
            :read-only="readOnly"
            @selected="selectedView"
          ></ViewsContextItem>

I hope that answers your question!

Yes, that answers it. I got it. I prevented the fields from being draggable.