Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Js grid get cell value cellClick #1417

Open
ashish435 opened this issue Oct 4, 2022 · 2 comments
Open

Js grid get cell value cellClick #1417

ashish435 opened this issue Oct 4, 2022 · 2 comments

Comments

@ashish435
Copy link

Hi Team
I have js grid and three field Name, Age , MobileNo . So my question is i want to get a value of cell when we click on the cell
Example : if i click on name then in alert msg Name value should be print , if i click on age then age value should be print.
So basically its like cell click event

I have used rowClick but its not get solve my problem .i check in jsgrid tutorial and did not find any solution
Please help me in this topic

@djdance
Copy link

djdance commented Jan 13, 2023

I use to get it so

            rowClick: function(args) {
                let x=args.event.target.cellIndex
                let y=args.itemIndex
                let cell=Object.values(args.item)[x??0]
                console.log("rowClick cell["+x+","+y+"]=",cell)
            },

@djdance
Copy link

djdance commented Jan 13, 2023

even so:

let field=this.option("fields")[x]
let cell=args.item[field.name]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants