Author Topic: cellClick event  (Read 2479 times)

arbyter

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 43
  • Retired IT Guy
    • View Profile
cellClick event
« on: December 17, 2019, 03:08:29 pm »
hi
i tried to establish a cellClick eventhandler but no success at first.
Played with the Demos, here my results:
   $(function () {
        var data = [
            { rank: 1, company: 'Exxon Mobil', revenues: 339938.0, profits: 36130.0 },
   ....
            { rank: 2, company: 'Wal-Mart Stores', revenues: 315654.0, profits: 11231.0 },
            { rank: 19, company: 'Crédit Agricole', revenues: 110764.6, profits: 7434.3 },
            { rank: 20, company: 'American Intl. Group', revenues: 108905.0, profits: 10477.0 }
        ];

        var obj = {
            width: "80%",
            height: 400,
            resizable: true,
            title: "Grid From JSON",
            showBottom: false,
            scrollModel: { autoFit: true },
            dataModel: { data: data }
   //,cellClick:function(event,ui){console.log(ui)}  //works
        };
        $("#grid_json").pqGrid(obj);
   $("#grid_json").pqGrid("option",{cellClick:function( event, ui ) {console.log(ui)} }) //works
   //$("#grid_json").on( "pqGrid:cellClick", function( event, ui ) {console.log(ui)} ); //does not work
   
    });   
   

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: cellClick event
« Reply #1 on: December 17, 2019, 09:13:03 pm »
Please read the documentation on pq event system:

https://paramquery.com/pro/tutorial#topic-events