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

Custom Editor for DataTable cell? #360

Closed
ishara opened this issue May 14, 2016 · 12 comments
Closed

Custom Editor for DataTable cell? #360

ishara opened this issue May 14, 2016 · 12 comments
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@ishara
Copy link

ishara commented May 14, 2016

How can Add custom cell editor for DataTable ?

@Mrtcndkn
Copy link
Contributor

Do you need something like this http://www.primefaces.org/primeng/#/datatableeditable ?

@ishara
Copy link
Author

ishara commented May 17, 2016

Yes , but I need to add Calendar , Dropdown and myOwnCell Editor component to DataTable cell.

@Mrtcndkn
Copy link
Contributor

Then take a look at this one please http://primefaces.org/primeng/#/datatabletemplating

@ishara
Copy link
Author

ishara commented May 24, 2016

It seems for custom cell rendering solution, I need to add 'p-calendar' component in to the table cell.

@cagataycivici cagataycivici self-assigned this Dec 30, 2016
@cagataycivici cagataycivici added this to the 2.0 milestone Dec 30, 2016
@cagataycivici cagataycivici added the Type: New Feature Issue contains a new feature or new component request label Dec 30, 2016
@cagataycivici
Copy link
Member

cagataycivici commented Jan 5, 2017

screen shot 2017-01-05 at 22 50 58

Ready for 2.0, used such as;

<p-dataTable [value]="cars" [editable]="true">
    <p-column field="vin" header="Vin" [editable]="true"></p-column>
    <p-column field="year" header="Year" [editable]="true"></p-column>
    <p-column field="brand" header="Brand" [editable]="true" [style]="{'overflow':'visible'}">
        <template let-col let-car="rowData" pTemplate="editor">
            <p-dropdown [(ngModel)]="car[col.field]" [options]="brands" [autoWidth]="false" [style]="{'width':'100%'}" required="true"></p-dropdown>
        </template>
    </p-column>
    <p-column field="color" header="Color" [editable]="true"></p-column>
    <p-column field="saleDate" header="Sale Date" [editable]="true" [style]=" {'overflow':'visible' }">
        <template let-col let-car="rowData" pTemplate="body">
             { {car[col.field]|date } }
        </template>
        <template let-col let-car="rowData" pTemplate="editor">
            <p-calendar [(ngModel)]="car[col.field]"></p-calendar>
        </template>
    </p-column>
</p-dataTable>

@mukeshkamboj
Copy link

@cagataycivici
Thanks for the above example.
How we can show the date along with time?

@MJuma
Copy link

MJuma commented Mar 22, 2017

@mukeshkamboj
Copy link

@MJuma Thanks for your response. Yes this is true. I used it. :-)

@jtraband
Copy link

I'm having trouble using almost exactly the same code in the treeTable. No error but no display either. Any ideas?

@deveshsinghal22
Copy link

@cagataycivici I am facing an issue in the same scenario.
As soon As I push a new object in the array, to add a new row. data table, replaces each row with the new added json, which has the json fields like null/blank.

@cagataycivici
Copy link
Member

Please create a new issue ticket for new cases to be reviewed.

@nag0538
Copy link

nag0538 commented Sep 19, 2017

how to save the data to back end after changes made?
Can anyone please guide me on this?

atretyak1985 pushed a commit to Nanitor/primeng that referenced this issue Jul 18, 2020
[NNTR-284]Add filters on issue devices page
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

8 participants