Grid cell focused instead of dropdownlist search input when using column template
i I have used column template to display searchable dropdownlist in grid cell but when clicking on on drop down it should focus on search input. but it focus on the cell . My code:
Hi Md. Sujon,
Greetings from Syncfusion support.
We have developed a sample based on the provided code example. The reported issue concerning the focus not being properly set on the search input of the DropDownList component occurs only at random times. Therefore, we recommend using the following code lines to address this issue. Please refer to the code example below, where we set the focus on the search element of the DropDownList component during its open event to prevent the focus from shifting to the Grid cell.
|
App.vue <ejs-grid id="gridSection" height="100%" width="100%" ref="gridSection" :dataSource='data' :allowSorting="true" :allowResizing='true' :toolbar='toolbar' :locale="locale" :rowHeight='30' > <e-columns> ……………. <e-column headerText='Order Status' type="string" :template="'mainClassificationTemplate'" width=200 :allowEditing="false"></e-column> </e-columns> <template v-slot:mainClassificationTemplate="{data}"> <div><ejs-dropdownlist :id='"mainClassificationdropdownlist_" + data.OrderID' :dataSource='dropData' :allowFiltering="true" :fields="classificationField" popupWidth='auto' :open="onDropDownOpen" :showClearButton="true"> </ejs-dropdownlist></div> </template> </ejs-grid>
onDropDownOpen(args) { const searchInput = args.popup.element.querySelector('.e-input-filter'); if (searchInput) { searchInput.focus(); } },
|
Sample: Yrfnk7 (forked) - StackBlitz
Screenshot:
Additionally, from the shared code example, we noticed that you are using the allowEditing property directly in the Grid. This property should be defined within the editSettings property of the Grid. Furthermore, the 'mainClassificationName' column includes a property autocomplete="off", which is not a defined property of Syncfusion Grid columns. Please refer to the API documentation below to learn more about the properties and methods of Syncfusion Grid.
API Links:
Regards
Aishwarya R
- 1 Reply
- 2 Participants
-
MS Md. Sujon
- Oct 28, 2024 04:29 AM UTC
- Oct 30, 2024 12:30 PM UTC