Author Topic: Need simple cell click to return cell value  (Read 5000 times)

larksys

  • Newbie
  • *
  • Posts: 23
    • View Profile
Need simple cell click to return cell value
« on: May 01, 2015, 07:25:06 am »
I guess I just don't understand.  How can I get the value of the cell that is clicked?

$("#userslistdiv").pqGrid({
            width: 560, height: 470, title: "Select Participant", dataModel: dataModel, colModel: colM, scrollModel: {horizontal: false   },
            flexHeight: true, selectionModel: { type: 'cell'},
            selectionModel: { type: 'cell', mode: 'block' }
         });

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Need simple cell click to return cell value
« Reply #1 on: May 04, 2015, 03:51:01 pm »
you would use cellClick event to get cell value of the clicked cell.

Code: [Select]
cellClick: function(evt, ui){
       var $td = $(evt.currentTarget).closest("td");
       alert($td.text());
}

http://jsfiddle.net/bphnecvm/129/

larksys

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Need simple cell click to return cell value
« Reply #2 on: May 06, 2015, 06:25:39 am »
Thank you very much.  PQgrid is starting to make sense.