⚠ 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

Undefined success_message on delete



maxth
  • profile picture
  • Member

Posted 24 October 2017 - 03:28 AM

Hi. I got grocerycrud (ver. 1.5.9) on Codeigniter(3.1.6)

I tried to run the example code  ( employees, orders etc) and it's fine but when I tried to delete, the data gets deleted but the  grid doesn't reload and an error on console says "success_message is not defined".It's a default setup - no other scripts are added to the page.

 

Uncaught ReferenceError: success_message is not defined
    at Object.success (datatables.js:210)
    at j (jquery-1.11.1.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-1.11.1.min.js:2)
    at x (jquery-1.11.1.min.js:4)
    at XMLHttpRequest.b (jquery-1.11.1.min.js:4)



 


maxth
  • profile picture
  • Member

Posted 25 October 2017 - 01:00 AM

I just found the cause of this. Function success_message is defined in jquery.noty.config.js. However, the code for including this config file is inside an if statement block located in the list_template.php. Thus, if you do not define $dialog_forms, jquery.noty.config.js will not be loaded. 

if ($dialog_forms) {
        $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/jquery.noty.js');
        $this->set_js_lib($this->default_javascript_path.'/jquery_plugins/config/jquery.noty.config.js');
        $this->set_js_lib($this->default_javascript_path.'/common/lazyload-min.js');
}

moalla
  • profile picture
  • Member

Posted 03 July 2018 - 02:46 AM

I have the same problem but didn't get how you solved the issue. would you tell me the process?


moalla
  • profile picture
  • Member

Posted 03 July 2018 - 02:50 AM

oh now I got it.
I enabled:

     $config['grocery_crud_dialog_forms'] = true; 

in config file.

 

it seems there is a problem with datatables theme as I explained here:
/topic/4350-delete-button-in-datatables-theme-not-functioning/