enable to get data from ListBox2 in dual list box

Hi

I am using dual list box control but not able to find out data from second list(ListBox2)

I also refer following link:-

https://stackblitz.com/edit/angular-vqjkkv?file=app.component.ts

but my datasource is always null.

Here is my code:-

<div class="dual-list-wrapper">
          <div class="dual-list-groupa">
            <ejs-listbox #listbox1 [dataSource]="Columns" [fields]="chooseColumnfields" height="200px"
                         [toolbarSettings]="Listtoolbar" scope="#listbox2" [allowDragAndDrop]="true"></ejs-listbox>
          </div>
          <div class="dual-list-groupb">
            <ejs-listbox #listbox2 id="listbox2" [fields]="chooseColumnfields" height="200px"  [allowDragAndDrop]="true"
                         [dataSource]='List2DataSrc'></ejs-listbox>
          </div>
        </div>

Please help also I need Toolbox click event.



Namita Singla


6 Replies 1 reply marked as answer

AS Aravinthan Seetharaman Syncfusion Team February 9, 2021 03:06 PM UTC

 
Thanks for contacting Syncfusion Support. 
 
We have checked your reported query.  
 
Query1: my datasource is always null. 
 
Ans:  We have checked your query and sample. We cannot reproduce your reported issue in our end. And we suspect that you are trying to get current data items from listbox. We can get dataItems of the listbox by using getDataList method as like in the below code snippet.  
 
 
click() { 
    var data = this.listObj2.getDataList(); 
    console.log(data); 
  } 
 
 
For your reference we have created sample here. 
 
 
If you are still facing the issue, kindly share the below details.  
                
·        If possible, try to reproduce the reported issue in provided sample or share the issue reproducible sample. 
·        Please share us the video demonstration of this issue. 
 
Query2: I need Toolbox click event. 
 
Ans: In ListBox we have actionBegin and actionComplete events which will be triggered when clicking the toolbar buttons. For your reference we have provided code snippet and sample here.  
 
 
<ejs-listbox [dataSource]="dataA" #listbox1 [toolbarSettings]="toolbarSettings"  
      scope="#connected-list" [fields]="fields" (actionBegin)="actionBegin($event)" 
      (actionComplete)="actionComplete($event)"> 
</ejs-listbox> 
 
 
actionBegin(args) { 
    console.log(args); 
  } 
  actionComplete(args) { 
    console.log(args); 
  } 
 
For your reference we have created sample here. 
 
 
Could you please check the above details, and get back to us with requested details. Based on that we will check and provide you a better solution quickly. 
 
Regards, 
Aravinthan S 



NA Namita February 12, 2021 10:48 AM UTC

Hi

GeDataList is returning null


AS Aravinthan Seetharaman Syncfusion Team February 15, 2021 12:17 PM UTC

Hi Namita, 
 
Thanks for the update. 
 
We have checked your query with multiple cases, andwe cannot get null while using getDataList method. For your reference we have created video demonstration and sample here. 
 
 
 
If you are still facing the issue, kindly share the below details. 
 
·        Please share us the features that you are enabled in ListBox. 
·        Please share the exact use case scenario to reproduce the issue. 
·        If possible, try to reproduce the reported issue in provided sample or share the issue reproducible sample. 
·        Please share us the video demonstration of this issue. 
·        Please share us the Essential Studio Product Version. 
 
Please provide the above requested information, based on that we will check and provide you a better solution quickly. 
 
Regards, 
Aravinthan S


NA Namita February 16, 2021 05:58 AM UTC

Can we use getDataList on actionCompleted event?


NA Namita February 17, 2021 02:33 AM UTC

OK, I got it but can we pick the data of list2 on actionCompleted event?


AS Aravinthan Seetharaman Syncfusion Team February 17, 2021 08:56 AM UTC

Hi Namita, 
 
Thanks for the update. 
 
We have checked your reported query, we can use GetDataList method in actionComplete event to get data form required listbox, as like in the below code snippet. 
 
app.component.html 
 
<ejs-listbox id="connected-list" #listbox2 [dataSource]="dataB" height="330px" [fields]="fields" 
            (actionComplete)="actionComplete($event)"  scope="#connected-list" >   
</ejs-listbox> 
 
 
app.component.ts 
 
actionComplete(args) { 
    var data = this.listObj2.getDataList(); 
    console.log(data); 
 
 
 
For your reference we have prepared sample here. 
 
 
Could you please check the above details, and get back to us, if you need assistance on this. 
 
Regards, 
Aravinthan S 


Marked as answer
Loader.
Up arrow icon