[SOLVED] twitter like pagination |
[eluser]arro[/eluser]
hii all, I wanna ask about paging like twitter style.. I have read -http://www.thetutorialblog.com/php/twitter-like-pagination-using-codeigniter-and-jquery/- and try it, it's work.. this is my controller Code: function get_messages_people($id,$offset) this is my model Code: function get_messages_people($id,$offset=0){ if I'm no using the $id, it's great work, but when use $id, this not work.. and I get error when I use $id -> Message: Undefined variable: offset what the problem here? thank you in advance.... [SOLVED] thanks for this forum and who's help me to fix this problem.. especially thanks to Christian Gile..
[eluser]InsiteFX[/eluser]
Please read the CodeIgniter User Guide on get_where! CodeIgniter User Guide - Active Record Class - $this->db->get_where(); InsiteFX
[eluser]arro[/eluser]
still got error in my controller -> $offset unidentified... I didn't understand with many realtionship table.. how if I have this model to implement get_where? Code: function get_messages_people($id,$offset=0){
[eluser]InsiteFX[/eluser]
I do not have the time to write this for you, but the last two lines should be like below for example Code: function get_messages_people($id, $limit = NULL, $offset = NULL) InsiteFX
[eluser]arro[/eluser]
I still got error in my controller... Code: function get_messages_people($id,$offset) Code: A PHP Error was encountered I'm confused with how to declaration $offset in my controller?? thank you so much InsiteFX ...
[eluser]Cristian Gilè[/eluser]
[quote author="arro" date="1295256323"]I still got error in my controller... Code: function get_messages_people($id,$offset) Code: A PHP Error was encountered I'm confused with how to declaration $offset in my controller?? thank you so much InsiteFX ...[/quote] Do you pass the offset parameter to the controller get_messages_people function when you call it? If it's an optional parametet set it to: Code: function get_messages_people($id,$offset = 0) Cristian Gilè
[eluser]arro[/eluser]
thanks for the reply, Cristian Gilè, I have try before, the error was diseapear but not work too.. hmm.. this is in my view.. Code: var num_messages = <?php echo $num_messages?>; any ideas or link how to make "more button" pagination? I am very confused with this controller... thanks before..
[eluser]Cristian Gilè[/eluser]
[quote author="arro" date="1295368508"]thanks for the reply, Cristian Gilè, I have try before, the error was diseapear but not work too.. hmm.. this is in my view.. Code: var num_messages = <?php echo $num_messages?>; any ideas or link how to make "more button" pagination? I am very confused with this controller... thanks before..[/quote] get_messages_people requires two parameters, id and offset, so the get request in jquery should be like this. Code: $.get("http://localhost/myweb/people/get_messages_people/" + id + "/" + loaded_messages, function(data){ Cristian Gilè
[eluser]arro[/eluser]
this problem has solved..you are the man Cristian Gilè.... thank you so much for your help.. |
Welcome Guest, Not a member yet? Register Sign In |