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

Custom destroy command click event not firing

1 Answer 253 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 25 Nov 2013, 05:20 PM
Hello,

In my Grid i have a column with 2 commands, which both use custom functionality like this.
{
  className: "btn-edit",
  text: "Bewerken",
  name: "edit",
  click: function (e) {
      e.preventDefault();
      var tr = $(e.target).closest("tr"); /* get the current table row (tr) */
      var data = this.dataItem(tr);
      CIX.CRM.Navigate('/businesses/' + data.ID, '/administration', data);
      }
},
{
  className: "btn-destroy",
  name: "destroy",
  text: "Verwijderen",
  click: function (e) {
               e.preventDefault();
               var tr = $(e.target).closest("tr"); /* get the current table row (tr) */
               var data = this.dataItem(tr);
               CIX.CRM.MessageDialog("Verwijderen", data.Code + ' - ' + data.Name, "Weet u zeker dat u " + data.Name + " wilt verwijderen ?",  [{ title: "Ja", action: _delete }, { title: "Nee", action: _cancelDelete }], data);
    }
 }

The problem is... when i give the 2nd command the name "destroy", the click event of that command is never called. When i give it another name, it doesn't show the destroy icon and leaves the inner span with an empty classname.

is there another way to have an icon with the destroy action without breaking the click event handler ?

Thanks in advance.


1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 27 Nov 2013, 12:16 PM
Hello Marcel,

destroy and edit commands are already built into the Grid and using the same names is not a good idea. If you want to use the same icon, then I would suggest you to create a template column like this:

http://jsbin.com/EjUPiZoK/4/edit

Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Marcel
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or