|
Index.js
cellSelecting(args){
var column = this.gridInstance.getColumnByIndex(args.cellIndex.cellIndex).field;
if( column === "CustomerName"){
document.getElementById('clksrc').innerHTML = args.data[column];
this.gridInstance.element.style.display = "none";
this.gridInstance2.element.style.display = "";
}
}
load(args){
this.gridInstance2.element.style.display = "none";
} |
|
[index.js]
<GridComponent
dataSource={orderDataSource}
ref={g=>this.gridInstance=g}
toolbar={toolbarOptions}
allowPaging={true}
cellSelecting={cellSelecting.bind(this)}
editSettings={editSettings}
actionBegin={actionBegin.bind(this)}
selectionSettings={selectionSettings}
>
. . . . |
Hi Team,
For me cellSelecting function is not working. I am using cellSelecting() in React functional component with versions mentioned below. I need to get cell data when I click on cell. I tried with syncfusion/ej2: 17.4.55 version also but didn't work out.
Hi Leela,
Thanks for your update.
Based on the provided information, we suspect that you are trying to select a cell using the `cellSelecting()`, but `cellSelecting` is an event that will be triggered before selecting cell, it cannot be used for selecting a cell. We suggest you to use the `selectCell` method of the EJ2 Grid, using which you can select the required cell.
Please refer the below code example.
|
onDataBound() { if (this.initialRender) { this.initialRender = false; this.gridInstance.selectCell({ rowIndex: 0, cellIndex: 2 }); } }
|
Sample: https://stackblitz.com/edit/react-rcnjqb-st8sag?file=index.js
Please get back to us for further details.
Regards,
Joseph I.
Hi,
Thanks for your reply.
My requirement is when ever I click on checkbox it should selects row but it shouldn't select row when we do row clicking. And I need to show update popup when we click on unique id cell. In which way we can achieve it.
Regards,
Leela
Hi Leela,
Thanks for your update.
Query 1: Whenever I click on checkbox it should selects row but it shouldn't select row when we do row clicking.
Based on your requirement, you want to select only using the checkbox, when you click on the row you do not want to select row. We have achieved your requirement, by using the `rowSelecting` event of the EJ2 Grid.
Please refer the below code example.
|
rowSelecting(args) { if (!args.target.parentElement.classList.contains('e-checkbox-wrapper')) { args.cancel = true; } }
|
Sample: https://stackblitz.com/edit/react-rcnjqb-wv8ugm?file=index.js
Query 2: Need to show update popup when we click on unique id cell.
Before proceeding to the solution, we would like you to explain your requirement in detail. You have mentioned that when you click on the unique id cell, you want to show update popup, do you want to show the edit dialog (Dialog edit mode), or do you want to show a custom popup.
Please get back to us for further details.
Regards,
Joseph I.
Hi Joseph,
Thanks for your reply.
Second Query : I need to show a custom popup with prefilled data in fields and editable.
Regards
Leela
Hi Leela,
We are still not clear of your requirement, kindly explain your requirement in detail and provide the below details to proceed further.
Regards,
Joseph I.