Announcement

Collapse
No announcement yet.

Current solution to disable Kansan drag and drop?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Current solution to disable Kansan drag and drop?

    Hey guys, as you know, kanban allows to override all fields' logics and simply mark any record as 'Won', 'Completed', etc, what is the current, most easy way to implement a restriction on drag-n-drop on records between stages?

    Thank you

  • #2
    If you give access to read only for the kanban status field then the user won't be able to drag and drop (but also they won't be able to edit that field on detail view).
    Rabii
    Web Dev

    Comment


    • #3
      Thanks rabii.

      Whole question is to disable pure Kanban stage change. Leave details view change.

      Comment


      • #4
        Hey Russ

        If you mean disable drag and drop then i am afraid it is not possible at this stage. Only solution is the one i mentioned before. see a reply from Yuri here
        Is it possible to disable/prohibit drag & drop for a particular entity? If yes, please tell me how to do it
        Rabii
        Web Dev

        Comment


        • #5
          This is pretty simple. Define custom kanban record view in clientDefs -> {Your entity type} -> recordViews -> kanban.
          In js file paste this code
          PHP Code:
          define(['views/record/kanban'], function (KanbanView) {
            return class extends 
          KanbanView {

              
          rowActionsView 'views/record/row-actions/default'

              
          afterRender () {
                
          super.afterRender();
                
          this.plusElementMap = {};
              }

              
          initSortable () {
                
          super.initSortable();
                
          let cancelSelectors this.$groupColumnList.sortable('option''cancel');
                if (
          typeof cancelSelectors === 'string') {
                  
          cancelSelectors += ',.group-column-list';
                } else {
                  
          cancelSelectors '.group-column-list';
                }
                
          this.$groupColumnList.sortable('option''cancel'cancelSelectors);
              }

              
          actionMoveOver(data) {}

            }
          });
          ​ 
          This will remove drag & drop feature, plus sign in every status column for record creation and rowAction moveOver. You can customize it further for your needs
          Last edited by a.slyzhko; 08-02-2024, 09:37 PM.

          Comment


          • #6
            thanks guys

            Comment

            Working...
            X