Search Field & Pagination is not working
- Single Page
Posted 02 February 2013 - 16:41 PM
this feature is not working on my created table. but it is working on all other example table.
[attachment=456:44.jpg]
I tried to find out but failed. All link of example database it is working except my table.
please give a solution.
Posted 02 February 2013 - 17:22 PM
Posted 02 February 2013 - 23:32 PM
Posted 03 February 2013 - 18:00 PM
show your code
Thanks Victor, I found few solution to view ur solution from other posts. I found my problem also.
I am using session data to show username who logged in my application. I am using custom login controller.
when i use this code:
$data=$this->session->all_userdata(); $username=$data['username']; echo 'Logged In username: '.$username;
I found that pagination and search option was not working. when ever i remove that three line code, then pagination and search option is working fine. this code is problem on flexigrid theme only, but datatables working fine.
can you please give me how to show username and use session data?
Posted 03 February 2013 - 21:54 PM
what error do you have? Have a look at error panel in your browser.
Posted 05 February 2013 - 03:44 AM
what error do you have? Have a look at error panel in your browser.
If I try to search anything, then search option is searching but nothing happens. search option is not find data and it stay on same page. See the below image.
[attachment=457:44.jpg]
In pagination, If I click on pagination button, 1>2>3 then pagination number is chaging but data is not changing, like.
suppose, I have 30 data (1 to 30), Every page showing 10 data. If I click on 2nd page it should show 11 to 20 nos data. but it stay on previous page means its all time showing 1 to 10 nos data. same as 3rd page.
this problem arise whenever i use the below code:
$data=$this->session->all_userdata(); $username=$data['username']; echo 'Logged In username: '.$username;
Posted 05 February 2013 - 08:34 AM
Show full controller code! And what error do you get from firebug? Which tools do you use to debug js code?
Posted 08 February 2013 - 13:11 PM
Show full controller code! And what error do you get from firebug? Which tools do you use to debug js code?
see my code:
function files_management() { $data=$this->session->all_userdata(); echo 'Logged In username: '.$data['username']; $username=$data['username']; $crud = new grocery_CRUD(); //$crud->set_theme('datatables'); $crud->set_table('files'); $crud->unset_columns('description'); $crud->unset_fields('username'); $crud->callback_after_insert(array($this, 'log_user_after_insert')); $crud->callback_after_update(array($this, 'log_user_after_update')); $crud->set_field_upload('upload_file_url','assets/uploads/files'); $output = $crud->render(); $this->_example_output($output); }
1) if i use $crud->set_theme('datatables'); this line then searching and pagination working fine with these code. but its problem on flexigrid.
2) if i remove
$data=$this->session->all_userdata();
echo 'Logged In username: '.$data['username'];
$username=$data['username'];
these code, then searching and pagination of flexigrid and datatables theme working fine.
3)I am using firebug.
Posted 08 February 2013 - 13:22 PM
you can't use "echo" in controller!
read the user guard http://ellislab.com/codeigniter/user-guide/general/views.html
it isn't possible use "echo" in the controller.
You should transmit your data to the view
Posted 08 February 2013 - 17:52 PM
you can't use "echo" in controller!
read the user guard http://ellislab.com/codeigniter/user-guide/general/views.html
it isn't possible use "echo" in the controller.
You should transmit your data to the view
You can use echo command in codeigniter. please check it: http://ellislab.com/codeigniter/user-guide/general/controllers.html#what
I used echo command in controller on several project.
Please check Let's try it: Hello World!<?php class Blog extends CI_Controller { public function index() { echo 'Hello World!'; } } ?>
Thank you for your reply, I removed it and everything is fine. but didn't understand why it was not working. echo can be used in controller.
If it is bug then please solve it, I told you, my code was fine if I used datatable theme and its problem on flexigrid. if i use $crud->set_theme('datatables'); this line then everything is working fine.
anyways, thank you very much for your quick reply with the solution :)
Posted 08 February 2013 - 17:55 PM
You can use echo command in codeigniter.
Only if you don't use a view!
Posted 08 February 2013 - 18:03 PM
Only if you don't use a view!
ok. Thank you very much for your solution :). but why its working on datatables theme?
Posted 08 February 2013 - 18:05 PM
1)if you use a template (in your case you use it) and if you use compress output you can't use echo command.
2) This library use JSON data and in your case answer from server will be :
your_nicname{json:data}. it's a bad practice.
3) and your html isn't valid
your_nicname
<html>
....
</html>
Posted 08 February 2013 - 18:09 PM
ok. Thank you very much for your solution :). but why its working on datatables theme?
The datatables dont use AJAX! All search operations only use JavaScript for it.
Posted 08 February 2013 - 18:10 PM
Thank You.
Posted 08 February 2013 - 18:12 PM
ok. Thank you very much for your solution :). but why its working on datatables theme?
The datatables don't use AJAX! All search operations only use JavaScript for it.