jsgrid icon indicating copy to clipboard operation
jsgrid copied to clipboard

Js grid get cell value cellClick

Open ashish435 opened this issue 3 years ago • 2 comments

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

ashish435 avatar Oct 04 '22 07:10 ashish435

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 avatar Jan 13 '23 09:01 djdance

even so:

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

djdance avatar Jan 13 '23 13:01 djdance