Pagination error

edited May 2012 in Modules
I have a advanced module and i am loading the data-table through json object, Pagination and onclick ascending and descending is not working because i am loading the data from json. How to get the onclick asc and desc and pagination

Comments

  • edited 4:47PM
    Any console errors? What are your filters? And can you post your models list_items method.
  • edited 4:47PM
    function list_xxxitems($limit = NULL, $offset = NULL, $col = 'number', $order = 'asc')
    { if(isset( $_REQUEST['id'])) {
    $name = $_POST['id'];
    }
    $sql ="SELECT xxxtablename.number, xxxtablename.Date, xxxtablename2.name, xxxtablename.area, xxxtablename.phno, xxxtablename.code
    FROM xxxtablename
    LEFT JOIN xxxtablename2 ON xxxtablename2.Id = xxxtablename.Id
    LEFT JOIN xxxtablename3 ON xxxtablename3.Id = xxxtablename.Id";
    if(!empty($name)) {
    $sql.=" WHERE xxxtablename3.Name='".$name."'";
    }

    $query = $this->db->query($sql);
    $arr='';
    if ($query->num_rows() > 0)
    {
    foreach ($query->result() as $row)
    {
    $arr[] =$row;
    }
    }
    return $arr;
    }

    I am getting the values and in controller i am loading this and generating json value
    through which i am getting a value listed in my customized table, because of this i am not getting on click asc and desc and pagination
Sign In or Register to comment.