How to get the selected item from a kendo listview Angular

1 Answer 656 Views
ListView
hiba
Top achievements
Rank 1
hiba asked on 29 Apr 2021, 11:26 AM
This is the first time I am using kendo listview and I am wondering how to get the selected Item from the listView ! I mean how can I change the listView to selectable and then how can I recuperate the selected Item ? Can anyone help me ?

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 29 Apr 2021, 12:52 PM

Hi Hiba,

Currently the ListView component does not support selection functionality. We have this feature in mind and will implement it in the near future.

Please excuse us for any inconvenience caused.

Regards,
Dimiter Madjarov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

hiba
Top achievements
Rank 1
commented on 29 Apr 2021, 02:10 PM

Ok thank you for answering
Vedad
Top achievements
Rank 2
Bronze
Bronze
Veteran
commented on 07 Jan 2022, 01:19 AM

Hi Dimiter, 

any news on listView selection feature? 

I need it for a feature in our new app.. :)

Thank you and regards,

Vedad

Yanmario
Telerik team
commented on 11 Jan 2022, 11:23 AM

Hi Vedad,

The selection functionality isn't currently planned for the upcoming releases and we can't provide any specific timeline on the addition of the selection functionality. Please follow the feature request thread for any further updates on this matter:

https://feedback.telerik.com/kendo-angular-ui/1485461-listview-add-selection-functionality

Regards,
Yanmario
Progress Telerik
Vedad
Top achievements
Rank 2
Bronze
Bronze
Veteran
commented on 11 Jan 2022, 11:34 AM

Hi Yanmario,

thank you for your reply.

I am little disappointed that almost year after hiba's question such a simple feature still didn't even came to serious plans. 

I was able to found a workaround for this, but I always prefer built in solutions as they are cleaner.

I hope this will come higher on the list soon.

All the best,

Vedad

Pierre
Top achievements
Rank 2
Iron
Iron
commented on 18 Oct 2022, 03:58 PM

@vedad Can you share you workaround?
Vedad
Top achievements
Rank 2
Bronze
Bronze
Veteran
commented on 19 Oct 2022, 11:33 AM

Hi @Pierre, 

basically you need to use 


<ng-template kendoListViewItemTemplate let-dataItem="dataItem">
            <div class="item" >
              <div class="description" (click)="mySelectionEvent(dataItem)">
                <div class="item-name"> {{ dataItem.name }}</div>
                <div class="category-name"> {{ dataItem.category | lowercase | translate}} </div>
              </div>
            </div>

          </ng-template>

and then handle selection event within your code by using mySelectionEvent.

For example, I create list of selected items which i update on each event (select/deselect) and also I set up some data which i display externally. But, you can do anything with it afterwards.

I hope this helps.

Regards,

Vedad

Pierre
Top achievements
Rank 2
Iron
Iron
commented on 19 Oct 2022, 12:34 PM

@Vedad thanks for the time you take to share your solution. I will do that too. I d'ont understand we Teleirk do not have this function out of the box!

Regards,

Pierre

Vedad
Top achievements
Rank 2
Bronze
Bronze
Veteran
commented on 19 Oct 2022, 01:09 PM

No problem, if you need additional help write..

regards,

Vedad

Tags
ListView
Asked by
hiba
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or