title: SAPUI5 sap.ui.table.Table cell click event
body: <p>I have created a table is SAPUI5,now i want to make a cell clickable.This is my table </p>
  
  <pre><code>var oTable = new sap.ui.table.Table({
  
              visibleRowCount: 4,
              firstVisibleRow: 3,
              editable: false,
              rowHeight:40,
              align:"center",
              width:"100%",
              rowBorderStyle:"none",
              styleExpression :"color:white;",
              selectionMode: sap.ui.table.SelectionMode.Single,
  
           });
  
           //Define the columns and the control templates to be used
           var oColumn = new sap.ui.table.Column({
              label: new sap.ui.commons.Label({text: "RequestID"}),
              styleExpression :"'padding:10px 10px 10px 10px;'",
              template: new sap.ui.commons.TextView().bindProperty("text","RequestID"),
              sortProperty: "RequetID",
              filterProperty: "RequetID",
              width: "75px",
              hAlign: "Center"
           });
  
           oTable.addColumn(oColumn);
           oTable.addColumn(new sap.ui.table.Column({
              label: new sap.ui.commons.Label({text: "First Name"}),
              template: new sap.ui.commons.TextField().bindProperty("value","name"),
              sortProperty: "name",
              filterProperty: "name",
              width: "75px",
              hAlign: "Center"
           }));
           oTable.addColumn(new sap.ui.table.Column({
              label: new sap.ui.commons.Label({text: "Subject"}),
              template: new sap.ui.commons.TextField().bindProperty("value","Summary"),
              sortProperty: "Summary",
              filterProperty: "Summary",
              width: "100px",
              hAlign: "Center"
           }));
           oTable.addColumn(new sap.ui.table.Column({
              label: new sap.ui.commons.Label({text: "Attachment"}),
              template: new sap.ui.commons.Image().bindProperty("src", "src"),
              sortProperty: "src",
              filterProperty: "src",
              width: "75px",
              hAlign: "Center",
  
           }));
           oTable.addColumn(new sap.ui.table.Column({
              label: new sap.ui.commons.Label({text: "Create Date"}),
              template: new sap.ui.commons.TextField().bindProperty("value", "CreateDate"),
              sortProperty: "CreateDate",
              filterProperty: "CreateDate",
              width: "75px",
              hAlign: "Center",
  
           }));
           var oColumn=new sap.ui.table.Column({
                  label: new sap.ui.commons.Label({text: "Info"}),
                  template: new sap.ui.commons.Image().bindProperty("src", "src1"),
                  sortProperty: "src1",
                  filterProperty: "src1",
                  width: "75px",
                  hAlign: "Center",
                  addStyleClass: "infoimg",
               });
           oColumn.attachEvent("click",function cl(){alert("hi");});
           oTable.addColumn(oColumn);
           oTable.addColumn(new sap.ui.table.Column({
                  label: new sap.ui.commons.Label({text: "Status"}),
                  template: new sap.ui.commons.TextField().bindProperty("value", "Status"),
                  sortProperty: "Status",
                  filterProperty: "Status",
                  width: "75px",
                  hAlign: "Center"
               }));
  </code></pre>
  
  <p>Here is the array which i have binded with the table</p>
  
  <pre><code>var aData = [
                      {RequestID: 1, name: "Al",  Summary: "False Trading",  src: "images/docc.png", CreateDate: "21/08/2014", src1: "images/icn_info_unselected.png", Status: "Open"},
                      {RequestID: 27, name: "Andy",  Summary: "Invalid Transaction",  src: "images/pdff.png", CreateDate: "23/08/2014", src1: "images/icn_info_unselected.png", Status: "Open"},
                      {RequestID: 39, name: "Anita",  Summary: "False Trading",  src: "images/docc.png", CreateDate: "24/08/2014", src1: "images/icn_info_unselected.png", Status: "Open"},
                      {RequestID: 67, name: "Doris",  Summary: "Invalid Transaction",  src: "images/pdff.png", CreateDate: "25/08/2014", src1: "images/icn_info_unselected.png", Status: "Close"}
                   ];
  </code></pre>
  
  <p>Here I want to make image in the info column clickable.i have tried using jquery and javascript.</p>
  
  <p>jQUERY:-</p>
  
  <pre><code>$('#__image2-col5-row0').click(function() 
              {
                  alert("hi");
              });
  </code></pre>
  
  <p>JAVASCRIPT:-</p>
  
  <pre><code>    var a=document.getElementById('__image2-col5-row0');
      alert(a);
       a.attachEvent('click',  function() {
          alert('Hello world');
      });
  </code></pre>
  
  <p>Both These methods are not working.Javascript returnts the value of "a" as null.Does SAPUI5 has a inbuilt way of adding the event handler like click on a table cell</p>
  
  <p>Please Help</p>