Autocomplete with suggestions in datatable?

UI Components for Angular
Post Reply
tomm0
Posts: 6
Joined: 25 Oct 2017, 17:43

18 Nov 2017, 06:09

Is there a way to have the Autocomplete suggestions display in a datatable beneath the field with a header? I have things working now with the service returning an array of strings. I tried using ng-template, but I am unsure how to get the suggestions in a table as opposed to just a series of divs for each result.

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4295
Joined: 16 Oct 2011, 19:19
Location: Singapore

18 Nov 2017, 21:08

The requirement is not clear. Do you want to display autocomplete as part of table data(cells) or header/footer area.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

tomm0
Posts: 6
Joined: 25 Oct 2017, 17:43

18 Nov 2017, 23:31

Sorry. When typing into the autocomplete field the service is returning and Array of objects. I was hoping to have the area that displays the suggestions be a table. The table would have one header and each suggestion would appear as a separate row in the datatable.

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4295
Joined: 16 Oct 2011, 19:19
Location: Singapore

19 Nov 2017, 14:15

No, you can't display it as table. But you can use advanced feature to customize to look like similar to table.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

tomm0
Posts: 6
Joined: 25 Oct 2017, 17:43

19 Nov 2017, 18:45

Any suggestions on how to handle that?

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4295
Joined: 16 Oct 2011, 19:19
Location: Singapore

20 Nov 2017, 05:31

No, DataTable is complex entity and it is difficulit to make overlay as dataTable. But you can use advanced template feature to make it look like table.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

tomm0
Posts: 6
Joined: 25 Oct 2017, 17:43

20 Nov 2017, 19:47

Okay, this is where I am at right now: https://plnkr.co/edit/5RXBeIWOnWHvY9R7KlnW?p=preview

Any suggestions on making rows besides the first not have the blank header while also limiting the space between the rows?

Also, is there a more optimal way to do this?

Thanks

tomm0
Posts: 6
Joined: 25 Oct 2017, 17:43

06 Dec 2017, 16:01

Could you possibly point me in the right direction to make the template "look like a table" ?

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests