⚠ 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

Controller function with parameters



umairkhan
  • profile picture
  • Member

Posted 20 May 2012 - 14:00 PM

Can i call grocery crud in one of my controller function like this:


public function test($a=null){
$crud = new grocery_CRUD();
// more crud stuff here
}


since i want to check the parameter passed to function (uri segment) and then have to perform some operations w.r.t to grocery crud list. In this function grocery crud don't have add,edit,delete operations. Basically just have to show the list and depending on the parameter $a , i have to call a javascript function in my view.

Due to some reason i am getting javascript error:



Uncaught TypeError: Cannot read property 'total_results' of null
flexigrid.js:33

$.ajaxSubmit.success
flexigrid.js:33

$.fn.ajaxSubmit.options.success
jquery.form.js:150

b
jquery.js:121

c.extend.ajax.w.onreadystatechange
jquery.js:127


Whenever i try to do sorting or searching, list operations etc. I am using flexigrid.

Also i tried to do this with:


public function test(){
$a= $this->uri->segment(3);
$crud = new grocery_CRUD();
// more crud stuff here
}


This may be an issue certainly of this parameter/uri segment ($a) b/c grocerycrud hits the current url for ajax request. Any solution or workaround for this will be appreciated.

umairkhan
  • profile picture
  • Member

Posted 21 May 2012 - 05:26 AM

Anybody??