We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DropDown List

Thread ID:

Created:

Updated:

Platform:

Replies:

145571 Jun 28,2019 10:17 AM UTC Jul 1,2019 01:14 PM UTC Angular - EJ 2 1
loading
Tags: Grid
sunithra
Asked On June 28, 2019 10:17 AM UTC

Hi

 I need a help to control the click functionality in drop down from the header button,we are having list of Grid records with check box option,if we do select more than one record click functionality should enable for the particular option from the Header button drop down,if we didn't select any Grid record particular option from the Header button drop down should disable.Kindly find the below attached screen shot, by click on More button on the Header it will show the list of options,below that we are having records with check box option.


Thanks in Advance.


Regards,

Sunithra.C

Attachment: samplescreensht_4a369e7f.zip

Thavasianand Sankaranarayanan [Syncfusion]
Replied On July 1, 2019 01:14 PM UTC

Hi Sunithra, 

Greetings from Syncfusion support. 

We can achieve your requirement using the rowSelected, rowDeselected event of Grid. 

Refer the below code example. 

[app.component.html] 

<ejs-dropdownlist id='games' #dropdown width='150px' [dataSource]='sportsData' [value]='value' [fields]='fields' [placeholder]='waterMark' [popupHeight]='height'></ejs-dropdownlist> 
 
<ejs-grid [dataSource]='data' #grid allowPaging='true' (rowSelected)='rowSelected($event)' (rowDeselected)='rowDeselected($event)' [enableHover]="false" [allowSelection]="true" [selectionSettings]="selectOptions"> 
  <e-columns> 
    <e-column type='checkbox' width='50'></e-column> 
    <e-column field='OrderID' isPrimaryKey='true' headerText='Order ID' width='120' textAlign='Right'></e-column> 
    <e-column field='CustomerName' headerText='Customer Name' width='150'></e-column> 
    <e-column field='OrderDate' headerText='Order Date' width='130' format="yMd" textAlign='Right'></e-column> 
    <e-column field='Freight' headerText='Freight' width='120' format='C2' textAlign='Right'></e-column> 
    <e-column field='ShippedDate' headerText='Shipped Date' width='130' format="yMd" textAlign='Right'></e-column> 
  </e-columns> 
</ejs-grid> 
---------------------------------------------------------------------------------------- 
[app.component.ts] 

export class AppComponent { 
  @ViewChild('dropdown') 
  public dropdownObj: DropDownListComponent; 
  @ViewChild('grid') 
  public gridObj: GridComponent; 
   
    ---- 
 
  public ngOnInit(): void { 
    this.data = orderDetails; 
    this.selectOptions = { persistSelection: true }; 
  } 
  rowSelected(args) { 
    if (this.gridObj.getSelectedRowIndexes().length >= 2) { 
      this.dropdownObj.enabled = true; 
    } 
    else { 
      this.dropdownObj.enabled = false; 
    } 
  } 
  rowDeselected(args) { 
    if (this.gridObj.getSelectedRowIndexes().length < 2) { 
      this.dropdownObj.enabled = false; 
    } 
  } 
} 


We have prepared a simple sample in the following stackblitz link. 


Refer the help documentation. 




Regards, 
Thavasianand S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon