⚠ 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 forum is read-only and soon will be archived. ⚠


Ankit Limkar

Member Since 26 Oct 2015
Offline Last Active Dec 07 2015 01:09 PM
-----

Topics I've Started

{"success:true} / {"success:false} after insert

26 November 2015 - 07:37 AM

Hello GCians,

 

I am having problem with record addition. When I add a record and if validation is violated it shows

 

{"success:false}

 

and

 

{"success":true,"insert_primary_key":3,"success_message":"
Your data has been successfully stored into the database. Edit College-Discipline Subcategory<\/a> or Go back to list<\/a><\/p>","success_list_url":"http:\/\/localhost\/virtual_uni\/index.php\/admin_college_disp_sub\/index\/success\/3"}

 

on success.

 

Any idea if it has happened before to someone?


callback_column is not working

27 October 2015 - 07:39 AM

Hello there,

 

I am using callback_column but it is not working. I at last tried to return 'Hello' but that even is not shown.

 

$crud->callback_column('class_id',array($this,'load_class_in_view'));

 

function load_class_in_view($pk_value, $row)
{
    return "Hello";
}

 

Any Help??

 

 

Attached File  issue_2.jpg   18.75K   337 downloads

how to show custom error message after callback_before_insert

26 October 2015 - 08:28 AM

Hi there,

 

I have just started using GC and it's my learning curve.

 

I have written a callback which checks for record duplication by checking three columns simultaneously (Joining 3 WHEREs by 2 ANDs in a query).

 

 

function check_duplicate_class($post_array)
    {
        $this->load->model('class_model');
        $does_exist = $this->class_model->check_duplicate();
        if(!empty($does_exist))
        {
            $message = 'A class already exists';
            $this->form_validation->set_message('participant_unique', $message);
            return FALSE; 
        }
        else
        {
            return TRUE;
        }
    }

 

This works fine and prevents duplicate records.

but the problem is the message I have set is not shown. Instead javascript message "An error has occured on insert". What I am missing or what should I do in addition?