Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close datatable cell editor programmatically #822

Closed
turnerhayes opened this issue Mar 22, 2019 · 2 comments
Closed

Close datatable cell editor programmatically #822

turnerhayes opened this issue Mar 22, 2019 · 2 comments
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@turnerhayes
Copy link

I looked around the docs for this, but didn't see it, so apologies if it's already available.

I would like to be able to make a cell stop being edited apart from whatever logic the datatable uses to stop a cell from being edited. My particular use case is that I have some shortcut keys to set certain dates on a date input element, but despite the shortcuts working (and changing the component props), the cell remains editable after pressing the shortcuts.

There is no guarantee in receiving an immediate response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeReact PRO Support where support is provided within 4 business hours

I'm submitting a ... (check one with "x")

[ ] bug report
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

Codesandbox Case (Bug Reports)
Please fork the codesandbox below and create a case demonstrating your bug report. Issues without a codesandbox have much less possibility to be reviewed.

https://codesandbox.io/s/qjx332qq4

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

Please tell us about your environment:

  • React version:
  • PrimeReact version:
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]
@cagataycivici cagataycivici self-assigned this Mar 29, 2019
@cagataycivici cagataycivici added the Type: New Feature Issue contains a new feature or new component request label Mar 29, 2019
@cagataycivici cagataycivici added this to the 3.1.1 milestone Mar 29, 2019
@cagataycivici
Copy link
Member

I've added closeEditingCell method, you can get the ref of the datatable instance and call closeEditingCell. Similar to how exportCSV works.

@l3omtz
Copy link

l3omtz commented May 21, 2019

Hey @cagataycivici,
I don't see this method in the type file .d.ts

export class DataTable extends React.Component<DataTableProps,any> {
public exportCSV():void;
public filter(value:T, field:string, mode:string):void;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

3 participants