Utilizing row dragging in combination with a drag-and-drop source feature within ag-Grid

Can you combine "rowDrag" and "dndSource=true" functionalities?

I have learned that in order to enable dragging and dropping outside the grid, I need to set "dndSource=true". However, I am facing difficulty in using this feature along with the active "rowDrag" functionality.

Answer №2

If you want to enable both dndSource and row dragging simultaneously, you can achieve this by utilizing the rowDragEntireRow feature. This will hide the row dragging button and allow you to drag the entire row by clicking anywhere on it.

In your column definition, make sure to configure dndSource and set rowDragEntireRow to true on the grid.

<AgGridReact
    ref={rightGridRef}
    onGridReady={(event) => {
      setRightGridReady(true)
      event.api.sizeColumnsToFit()
    }}
    rowDragManaged={true}
    rowDragEntireRow={true}
    columnDefs={[
      {headerName: "", dndSource: true, width: 30, suppressMenu: true},
      {headerName: "Pivot By", field: 'name', suppressMenu: true}
    ]}
    rowData={selected.map((item) => {return {name: item}})}
    getRowNodeId={(data) => data.name}
/>

For more information on Entire Row Dragging, visit https://www.ag-grid.com/react-data-grid/row-dragging/

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How can I utilize PageFactory with Selenium WebdriverJS?

I am currently transitioning to writing my tests in TypeScript (using JavaScript is also an option) and struggling with understanding how to implement the PageFactory concept from C#. In C#, I typically create separate classes for each page or form on the ...

The Angular2 selector failed to find any elements matching the bundle and ECM6

I am working on a straightforward Angular 2 project that is set up to function with Gulp, Bundle, and ECM6. Using Bundle creates a large file that contains the translated ECM5 of angular along with my application. <!DOCTYPE html> <html> <he ...

Tips for personalizing the styling of ng-bootstrap components with Angular 2 and Bootstrap 4

Utilizing both ng-bootstrap components ngbDropdown and ngb-pagination, I am looking to have them aligned vertically next to each other. https://i.sstatic.net/c552P.png The ngb-pagination component generates this HTML with a class of .pagination and a mar ...

Guide to incorporating ThreeJS Collada loader with TypeScript / Angular CLI

I currently have three plugins installed: node_modules/three My Collada loader was also successfully installed in: node_modules/three-collada-loader It seems that the typings already include definitions for the Collada loader as well: node_modules/@ty ...

Eliminate the loading screen in Ionic 2

Within my app, there is a button that triggers the opening of WhatsApp and sends a sound. Attached to this button is a method that creates an Ionic loading component when clicked. The issue I am facing lies with the "loading.dismiss()" function. I want the ...

A type guard for generics in TypeScript

I'm dealing with a variable that can be either of type C1[] or C2<C1>[]. How can I create a type guard for this variable? interface C<T>{ key: string; secret: T; } private isC(d: Foo[] | C<Foo>): d is C<Foo>[] { ret ...

Creating an extended class in Typescript with a unique method that overrides another method with different argument types

I need to change the argument types of a method by overriding it: class Base { public myMethod(myString: string): undefined { return; } } class Child extends Base { public myMethod(myNumber: number): undefined { return super.m ...

Issue with QListWidget subclass: drag and drop event not triggering

The main widget in this window is a custom widget that extends QListWidget. It has been set to accept drops by using the function "setAcceptDrops(true);" in its constructor. Additionally, the "dragEnterEvent" method calls "event->accept();". However, fo ...

What is preventing me from assigning the HttpClient result to a class property?

I've hit a major roadblock with this issue. Despite scouring the internet and spending hours on Stack Overflow trying to understand HttpClient, I'm still not making any progress. The task at hand involves fetching data from a REST endpoint using ...

Angular 8 Input Validation: Implementing a Directive for Number Models

Criteria for Acceptance: • Input should only accept numbers • Numbers can have two decimal places • Both point and comma are valid separators (11,00 , 12.00) • Negative numbers should not be allowed • Point and comma cannot be ente ...

Is there a way for me to identify which item has been unselected from the dropdown menu?

I have a dropdown menu where users can select the languages they are proficient in, along with their proficiency level and years of experience. The user may select multiple choices but can also deselect options by mistake. Additionally, I am encountering ...

What are the ideal scenarios for implementing routing in Angular?

As I embarked on developing my inaugural Angular app, I initially implemented routing with unique URLs for each "main" component. However, upon encountering Angular Material and its appealing tab functionality, I was captivated. What are the advantages an ...

Issue with TypeScript: variable lacks an initializer and is not explicitly assigned within the constructor

Code: class Example { private server: string; constructor() { this.setServer(); } setServer(): void { this.server = 'server'; } } new Example(); Error: ⨯ Unable to compile TypeScript: src/index.ts:309:13 ...

The `pubnub removeListener` function does not get triggered when the `useEffect` hook

Operating a single chat works perfectly; however, upon entering and exiting a chat screen before re-entering it, double messaging occurs, and the listener remains active despite being placed in the return of useEffect. I attempted the solution provided in ...

What is the reason for the truth value of `type a = {} extends {a?:number}? true:false;`?

Why is type a = {} extends {a?:number}? true:false; evaluated as true, while type b = {a?:number} extends {}? true:false; is also true! It seems like the empty object {} acts as a supertype that can extend other types. This raises some questions about ...

Leveraging max-old-space-size with NPX

As I updated the scripts in package.json to incorporate NPX commands instead of relying on "./node_modules", I encountered the ng build command with the "max-old-space-size" argument. The modified command now looks like this: node --max-old-space-size=1024 ...

What is the best way to change a timestamp into a date format using Angular?

I am struggling to convert a timestamp to the date format 'dd/MM/YYYY' but keep getting a different date format in the output. I am using syncfusion spreadsheet for this task. https://i.sstatic.net/BoRaa.png export-electronic.component.ts updat ...

Experiencing difficulties with my .css formatting following the installation of bootstrap in Angular

I've been immersing myself in Angular and encountered an issue that has me stumped. Despite using the latest version of Bootstrap in my Angular project, I'm facing challenges with my styles.css file that was defined prior to installing Bootstrap. ...

Error: The AppModule encountered a NullInjectorError with resolve in a R3InjectorError

I encountered a strange error in my Angular project that seems to be related to the App Module. The error message does not provide a specific location in the code where it occurred. The exact error is as follows: ERROR Error: Uncaught (in promise): NullInj ...

Issue with Mongoose Validation Error Occurring on lastUpdated Field Even After Setting It Prior to Save操作

I'm experiencing a dilemma with Mongoose in my Node.js/Express project and I would really appreciate some assistance. The issue arises when attempting to update a Restaurant document in MongoDB. An error occurs indicating that the lastUpdated field is ...