⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Change the default insert url



Cèsar Martí
  • profile picture
  • Member

Posted 18 April 2012 - 12:06 PM

Is it possible to change the default insert url of the grid? I mean, when you click the "insert button" in the list grid go to somewhere else instead to the groceryCRUD insert form. Maybe with AJAX?

Thanks.

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 19 April 2012 - 06:22 AM

For now the only way to do it is to add a custom view with a javascript to do that. But will not open the add form with AJAX. You have to change some things to the library to do that.

Cèsar Martí
  • profile picture
  • Member

Posted 19 April 2012 - 07:46 AM

I made it with AJAX, but without changing the library. I added at the bottom of my view this lines and it's working.

[php]
<script type="text/javascript">
$("a[href='<?php echo base_url(); ?>my_controller/index/add']").attr('href', '<?php echo base_url(); ?>another_controller');
</script>
[/php]