Server side script failing while using editor api.
Server side script failing while using editor api.
i am trying to implement the inline edit using datatables.editor api in codeignitor.But my server side script is failing to update the data.Its throwing error "Fatal error: Call to a member function transaction() on a non-object in /media/recbackup/webserver/falcon/application/helpers/Editor/Editor.php on line 408".I think there is a problem in integrating with codeignitor.
My codes are as follows
$('#datatables').DataTable( {
ajax: global_base_url + "contact/update_records_list_view",
columns: [
{ data: null, defaultContent: '', orderable: false },
{ data: null, defaultContent: '', orderable: false },
{ data: null, defaultContent: '', orderable: false },
{ data: 3 },
{ data: 4 },
{ data: 5 },
{ data: 6 },
{ data: 7 },
{ data: 8 },
],
order: [ 1, 'asc' ],
tableTools: {
sRowSelect: "os",
sRowSelector: 'td:first-child',
}
} );
public function update_records_list_view()
{
$db= "";
Editor::inst($db,'contact' )
->fields(
Field::inst( 'email_primary',3 )->validator( 'Validate::email' ),
Field::inst( 'contact_home',4 )->validator( 'Validate::numeric' ),
Field::inst( 'contact_mobile',5 )->validator( 'Validate::numeric' ),
Field::inst( 'country',6 )->validator('Validate::notEmpty'),
Field::inst( 'unique_id',7 )->validator('Validate::notEmpty'),
Field::inst( 'title',8 )->validator( 'Validate::numeric' )
)
->process( $_POST )
->json();
}
I have failed to find anything after debugging of codes.Pls help.