⚠ 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

Help with a redirect



aaries

aaries
  • profile picture
  • Member

Posted 08 January 2012 - 19:37 PM

Hi i need your help in relation to, how to redirect after insert data on this table

[attachment=16:15378728471a1812df04c1365ff04da77c60aa46.jpg]


i want to after insert this data, it redirect to the maintaner of this table, as you can see in this picture

[attachment=17:1537874707136b9767041fa2dcc42d691b5728cc.jpg]

I dont want to it shows this screen

[attachment=18:15378749cb6f19031e0b0d5de0aa8783588222d9.jpg]

PLZ help!!!

regards

web-johnny

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

Posted 08 January 2012 - 20:07 PM

[quote name='aaries' timestamp='1326051467' post='245']
Hi i need your help in relation to, how to redirect after insert data on this table

[attachment=16:15378728471a1812df04c1365ff04da77c60aa46.jpg]


i want to after insert this data, it redirect to the maintaner of this table, as you can see in this picture

[attachment=17:1537874707136b9767041fa2dcc42d691b5728cc.jpg]

I dont want to it shows this screen

[attachment=18:15378749cb6f19031e0b0d5de0aa8783588222d9.jpg]

PLZ help!!!

regards
[/quote]

First of all please try to add images from this forum and don't add external links especially with sexual content ads. This forum supports images too. You can add images or files from "Attach files" option or press the button "More Reply Options" if you have a reply. I edited your post and delete you links and add the images again with the right way.

As I see to the images you use the datatables theme so you will do the same similar thing if you want to use this functionality to flexigrid theme also.

You can add a simple redirection with javascript.
Go to: assets/grocery_crud/themes/datatables/js/datatables-add.js for the add form and add to the line 33: (see //NEW LINE CODE)


$(function(){
$('.ptogtitle').click(function(){
if($(this).hasClass('vsble'))
{
$(this).removeClass('vsble');
$('#main-table-box').slideDown("slow");
}
else
{
$(this).addClass('vsble');
$('#main-table-box').slideUp("slow");
}
});

$("#FormLoading").ajaxStart(function(){
$(this).show();
});
$("#FormLoading").ajaxStop(function(){
$(this).fadeOut('slow');
});

$('#crudForm').submit(function(){
$(this).ajaxSubmit({
url: validation_url,
dataType: 'json',
success: function(data){
if(data.success)
{
$('#crudForm').ajaxSubmit({
dataType: 'text',
cache: 'false',
success: function(result){
window.location = list_url;//NEW LINE CODE
data = $.parseJSON( result );
if(data.success)
{
$('#report-error').hide().html('');
$('.field_error').each(function(){
$(this).removeClass('field_error');
});
clearForm();
..................................................


And the same thing for the edit form at: assets/grocery_crud/themes/datatables/js/datatables-edit.js line 19


$(function(){
$("#FormLoading").ajaxStart(function(){
$(this).show();
});
$("#FormLoading").ajaxStop(function(){
$(this).fadeOut('slow');
});

$('#crudForm').submit(function(){
$(this).ajaxSubmit({
url: validation_url,
dataType: 'json',
success: function(data){
if(data.success)
{
$('#crudForm').ajaxSubmit({
dataType: 'text',
cache: 'false',
success: function(result){
window.location = list_url; //NEW LINE WITH REDIRECTION HERE
data = $.parseJSON( result );
if(data.success)
{
$('#report-error').hide().html('');
$('.field_error').each(function(){
$(this).removeClass('field_error');
});
..........................

aaries

aaries
  • profile picture
  • Member

Posted 08 January 2012 - 20:53 PM

Oh, sorry for newbie ocurred, I appreciate your help on this tip.

regards