This is a migrated thread and some comments may be shown as answers.

Opening a view for a record via row click instead of button

1 Answer 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 31 Jul 2013, 06:27 PM
Hello all,

I am working with the very latest kendo release 2013.2.716 and MVC 4 with VS 2012.

 I have a kendo grid and it was decided to remove the buttons for displaying details and achieve this via row click. Easy enough right?

If I have an edit and delete button however, for each row in addition to the row click to show details, how do I exclude the edit and delete buttons from calling the row click instead of the edit or delete functionality? 

Any help is appreciated.
$("#grid tbody").on("click", "tr", showError);
showError.call($("grid tbody tr:first"));
 
   function showError() {
 
          if (documentReady) {
               
              var $this = $(this),
              dataItem = $this.data();
              var id = GetId(dataItem);
              if (id != 0) {                 
                  window.location.href = "/Error/ShowError/" + id;
              }
          }          
   }
   function GetId(item) {
       var items = grid.dataSource.data();
       for (var i = 0; i < items.length; i++) {
           var e = items[i];
           if (e.uid == item.uid) {
               return e.ExceptionLogId;
           }           
       }
       return 0;
   }


Paul

1 Answer, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 01 Aug 2013, 01:51 PM
Answered my own stupid question....just change this code
$("#grid tbody").on("click", "tr", showError);

to this

$("#grid tbody").on("dblclick", "tr", showError);

tunnel vision can drive you nutz
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Paul
Top achievements
Rank 1
Share this question
or