Welcome Guest, Not a member yet? Register   Sign In
help me..stackoverflow..about jquerymobile + codeigniter
#1

[eluser]firexas[/eluser]
anyone help me i'm stackoverlow..

i'm build a mobile web with jquery mobile for client side and codeigniter for server side + mysql.


why can't search for my search form?
this my code :
Code:
//Controller

function caribio()
{
  $cari = $this->input->post('cari');
  // Offset
$uri_segment = 3;
$offset = $this->uri->segment($uri_segment);
  
// Load data
$biologis = $this->biologis_model->get_all($this->limit, $offset);
$num_rows = $this->biologis_model->count_all();
  
if ($num_rows > 0)
  
// Generate pagination  
$config['base_url'] = site_url('mobile/caribio');
        $config['total_rows'] = $num_rows;
$config['per_page'] = $this->limit;
$config['uri_segment'] = $uri_segment;
$this->pagination->initialize($config);
$data['pagination'] = $this->pagination->create_links();
  
$query=$this->biologis_model->cari($cari);
$hasil=$query->result();
$num_rows=$query->num_rows();
  
  $tmpl = array( 'table_open'    => '<table border="0" cellpadding="0" cellspacing="0">',
  row_alt_start'  => '<tr class="zebra">',
         'row_alt_end'    => '</tr>'
   );
$this->table->set_template($tmpl);
        $this->table->set_empty("&nbsp;");
$this->table->set_empty("&nbsp;");
$this->table->set_heading('Nama Biologi','Isi');

        if ($num_rows > 0){
         foreach($hasil as $row)
{
  $this->table->add_row($row->nmbio, $row->isi);
  }
   $data['table'] = $this->table->generate();
         }
    else {
          $this->session->set_flashdata('message', 'data tidak ditemukan!');
  
  }
$this->load->view('mobile', $data);
        
}

}

//Model

function get_all($limit, $offset)
{

  $this->db->query('SELECT * FROM biologis');
  $this->db->from($this->table);
  $this->db->limit($limit, $offset);
  $this->db->order_by('idbio', 'asc');
  return $this->db->get()->result();
}
function count_all()
{
  return $this->db->count_all($this->table);
  
  
}
         function cari($cari)
{
  $this->db->like('nmbio', $cari);
        return $this->db->get('biologis');


}

//views
<!DOCTYPE html>
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;Mobile wiki biologi&lt;/title&gt;
        &lt;meta name="viewport" content="width=device-width,initial-scale=1"&gt;
        &lt;link rel="stylesheet" href="&lt;?php echo base_url('asset/mobile/lib/jquery.mobile-1.0.min.css');?&gt;" /&gt;
        &lt;link rel="stylesheet" href="&lt;?php echo base_url('asset/mobile/mobile.css');?&gt;" /&gt;
        [removed][removed]

        <  type="text/javascript" src="&lt;?php echo base_url('asset/mobile/mobile.js');?&gt;">[removed]
        <  type="text/javascript" src="&lt;?php echo base_url('asset/mobile/lib/jquery.mobile-1.0.min.js');?&gt;">[removed]
  <  type="text/javascript" src="&lt;?php echo base_url('asset/mobile/lib/jquery-ui-1.8.10.custom.min.js');?&gt;">[removed]
    &lt;/head&gt;
    [removed]
        var site = "&lt;?php echo site_url();?&gt;";
    [removed]
&lt;body&gt;

&lt;?php
            echo form_open('','name="f_caribio"');
        ?&gt;
        &lt;input type="text" name="cari" data-inline="true"&gt;
  &lt;input name="submit" id="submit" type="submit"   value="search" data-inline="false"&gt;
      &lt;/form&gt;
  



//mobile.js
  

function cari_bio(){

var formObj = document.f_caribio;
    $.ajax({
        url: site+"/mobile/caribio",  
        data: $(formObj.elements).serialize(),
        beforeSend:function(){
            $.mobile.showPageLoadingMsg();
        },
        success:function(response){
            $.mobile.hidePageLoadingMsg();
            $('#login_error').html(response);
            
                location = site+"/mobile";
            
        },
        type: "post",
        dataType: "html"
    });
    return false;



}



i'm very stackoverflow and confuse why can't running?

help me..thanks b4 and sory my english not good.

#2

[eluser]pbflash[/eluser]
This line:

row_alt_start' => '<tr class="zebra">',

Should be:

'row_alt_start' => '<tr class="zebra">',

Not sure if that is causing your problem.
#3

[eluser]InsiteFX[/eluser]
You are missing the single qoute on the row_alt_start!
Code:
$tmpl = array(
    'table_open'    => '<table border="0" cellpadding="0" cellspacing="0">',
    'row_alt_start' => '<tr class="zebra">',
    'row_alt_end'   => '</tr>'
);

Also you should be setting the whole table template like this:
Code:
$tmpl = array(
    'table_open'         => '<table border="0" cellpadding="0" cellspacing="0">',

    'thead_open'         => '<thead>',
    'thead_close'        => '</thead>',

    'heading_row_start'  => '<tr>',
    'heading_row_end'    => '</tr>',
    'heading_cell_start' => '<th>',
    'heading_cell_end'   => '</th>',

    'tbody_open'         => '<tbody>',
    'tbody_close'        => '</tbody>',

    'row_start'          => '<tr>',
    'row_end'            => '</tr>',
    'cell_start'         => '<td>',
    'cell_end'           => '</td>',

    'row_alt_start'      => '<tr class="zebra">',
    'row_alt_end'        => '</tr>',
    'cell_alt_start'     => '<td>',
    'cell_alt_end'       => '</td>',

    'table_close'        => '</table>'
);
#4

[eluser]firexas[/eluser]
[quote author="pbflash" date="1327884142"]This line:

row_alt_start' => '<tr class="zebra">',

Should be:

'row_alt_start' => '<tr class="zebra">',

Not sure if that is causing your problem. [/quote]



[quote author="InsiteFX" date="1327886061"]You are missing the single qoute on the row_alt_start!
Code:
$tmpl = array(
    'table_open'    => '<table border="0" cellpadding="0" cellspacing="0">',
    'row_alt_start' => '<tr class="zebra">',
    'row_alt_end'   => '</tr>'
);

Also you should be setting the whole table template like this:
Code:
$tmpl = array(
    'table_open'         => '<table border="0" cellpadding="0" cellspacing="0">',

    'thead_open'         => '<thead>',
    'thead_close'        => '</thead>',

    'heading_row_start'  => '<tr>',
    'heading_row_end'    => '</tr>',
    'heading_cell_start' => '<th>',
    'heading_cell_end'   => '</th>',

    'tbody_open'         => '<tbody>',
    'tbody_close'        => '</tbody>',

    'row_start'          => '<tr>',
    'row_end'            => '</tr>',
    'cell_start'         => '<td>',
    'cell_end'           => '</td>',

    'row_alt_start'      => '<tr class="zebra">',
    'row_alt_end'        => '</tr>',
    'cell_alt_start'     => '<td>',
    'cell_alt_end'       => '</td>',

    'table_close'        => '</table>'
);
[/quote]


@pbflash and InsiteFX : my problem not like that.

my problem can't process for searching result..?

confirm my problem "Error Loading page" on my UI.










Theme © iAndrew 2016 - Forum software by © MyBB