jsgrid icon indicating copy to clipboard operation
jsgrid copied to clipboard

Add or editing row in an other URL

Open adrianogoncalves opened this issue 4 years ago • 1 comments

Hi, I would like to know if it is possible to redirect the user to another page when clicking on add or edit buttons. I would like to do it externally and, after that, return to the grid.

Congratulations by your great job on jsGrid, and thanks in advance!

Adriano Gonçalves

adrianogoncalves avatar May 26 '21 22:05 adrianogoncalves

You can customize your jsGrid like:

$("#grid").jsGrid({
   ...

   /* Insert button */
   onItemInserting: function(args) {
      // cancel insertion of the item and do anything you want
      args.cancel = true;

      // redirect
      window.location = "http://your-url.example/insert?ID=" + args.item.ID;
   },

   /* Edit button */
   onItemEditing: function(args) {
      // cancel edition of the item and do anything you want
      args.cancel = true;

      // redirect
      window.location = "http://your-url.example/edit?ID=" + args.item.ID;
   }
);

More: http://js-grid.com/docs/#callbacks

herickbrandao avatar Jun 04 '21 17:06 herickbrandao