title: How to get selected row and its dataItem in the KendoUI?
body: <p>this is my Kendo Grid</p>
  
  <pre><code>dataSource = new kendo.data.DataSource({
                      transport: {
                          read: {
                              url: "/Actionables/GetAccessibleTemplateForAssets/",
                              data: { assetID: '@Model.AssetID', types: '@Model.TypeName' },
                              dataType:"Json",
                              type: "GET"
                          },
                      },                    
                      schema: {
                          model: {
                              id: "ID",
                              fields: {
                                  ID: { type: "int" },
                                  Name: { type: "string" },
                                  Description: { type: "string" },
                                  Types: { type: "string" },
                                  EntryGroupID: {type:"int"}
                              }
                          }
                      },
                      pageSize: 3,
  
                  });
                  $("#grid").kendoGrid({
                      dataSource: dataSource,
                      dataBound: onDataBound,
                      autoSync: true,
                      serverPaging: true,
                      serverSorting: true,
                      serverFiltering: true,
                      height: 250,
                      sortable: true,
                      filterable: {
                          mode: "row"
                      },
                      pageable: {
                          refresh: true,
                          pageSizes: true,
                          buttonCount: 5
                      },
                      columns:
                      [{
                          field: "Types",
                          width: 100,
                          title: "Type",
                          template: "&lt;image src='/Content/Images/Pins/#:data.Types#.png'/&gt;",
                          filterable: false
  
                      },{
                          field: "Name",
                          width: 150,
                          title: "Name",
                          filterable: {
                              cell: {
                                  operator: "contains"
                              }
                          }
                      }, {
                          field: "Description",
                          width: 150,
                          title: "Description",
                          filterable: {
                              cell: {
                                  operator: "contains"
                              }
                          }
                      },{
                          command: [
                              {  name: "remove", text: "&amp;nbsp;", click: removeTab, iconClass: "fa fa-trash" },
                              {  name:"view", text: "&amp;nbsp;", click: addTab , iconClass: "fa fa-plus-circle"}],
                              title: "Action",
                              width: 100,
  
  
                      }],
                      editable: {
                          mode:"popup"                            
                      },
                  }).data("kendoGrid");
  
                  wnd = $("#details").kendoWindow({
                      title: "View Tab",
                      modal: true,
                      visible: false,
                      resizable: false,
                      width: 300
                  }).data("kendoWindow");
                  detailsTemplate = kendo.template($("#ViewDetails").html());
  </code></pre>
  
  <p>this will get called when user clicked '+' sign in command column. it opens a popup window.</p>
  
  <pre><code>function addTab(e) {
      e.preventDefault();
      var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
      wnd.content(detailsTemplate(dataItem));
      wnd.center().open();
  }
  </code></pre>
  
  <p>the popup window contains two button, on that button click event OpenRecentlyClosed() function will get called.</p>
  
  <pre><code>&lt;script type="text/x-kendo-template" id="ViewDetails"&gt;
  &lt;div id="details-container"&gt;
      &lt;button id="oldEntryGroup" class="k-button" onclick="OpenRecentlyClosed()"&gt;Open recently closed&lt;/button&gt;
      &lt;br /&gt;&lt;br /&gt;
      &lt;button id="NewEntryGroup" class="k-button"&gt;Open new&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>the below function I'm trying to access dataItem of clicked/selected row. please help. thank you in advance</p>
  
  <pre><code>function OpenRecentlyClosed() {
      //trying to access dataItem here.. please help 
      //var grid = $("#grid").data("kendoGrid");
      //var dataItem = grid.dataItem(grid.select());
      $.ajax({
              cache: false,
              type: "GET",
              url: "some url",
              data: {x: dataItem.ID},// need to pass value of dataItem.ID 
              success: function () {
                  //my code
              }
      });
  }
  </code></pre>