Welcome Guest, Not a member yet? Register   Sign In
add css class to current row using HTML Table Class
#1

[eluser]kulldox[/eluser]
I have the following piece of code:
Code:
$data = $this->pages->pages(); // List the pages
        $this->table->set_heading(lang('title'), lang('slug'), lang('actions')); // Setting headings for the table

        $actions = '';
        foreach($data as $value => $key)
        {
            if( $key['status'] == '1') //if visible
            {
                $actions = anchor(prep_url(base_url())."pages/hide/".$key['id']."/", '<img src="'.prep_url(base_url()).'img/visible.png">', array('title' => (lang('hide').' '.lang('page')))); // Build actions links
            } else {
                $actions = anchor(prep_url(base_url())."pages/show/".$key['id']."/", '<img src="'.prep_url(base_url()).'img/hidden.png">', array('title' => (lang('show').' '.lang('page')))); // Build actions links
            }
            $actions .= ' ';
            $actions .= anchor(prep_url(base_url())."pages/edit/".$key['id']."/", '<img src="'.prep_url(base_url()).'img/edit.png">', array('title' => (lang('edit').' '.lang('page'))));
            $actions .= ' ';
            $actions .= anchor(prep_url(base_url())."pages/delete/".$key['id']."/", '<img src="'.prep_url(base_url()).'img/emptytrash.png">', array('title' => (lang('delete').' '.lang('page')))); // Build actions links
            
            $trClass = '<tr class="'.($key['status'] == '2' ? 'hidden' : '').'">';
            $tableTmpl = array (
                'row_start'  => $trClass,
                'row_alt_start' => $trClass
            );
            //var_dump($tableTmpl);
            $this->table->set_template($tableTmpl);        
            $this->table->add_row($key['title'], $key['slug'], $actions); // Adding row to table
        }

What I want to do i to set a the .hidden css class to the row that has:
Code:
$key['status'] = '2'
which stands for hidden.

The way I did it here actually sets the classes for whole table but not the current row.

How to do it for the current row using the HTML Table Class?

Shure I know how to do it with out HTML Table Class Big Grin


Messages In This Thread
add css class to current row using HTML Table Class - by El Forum - 08-30-2009, 04:23 AM
add css class to current row using HTML Table Class - by El Forum - 08-30-2009, 05:18 AM
add css class to current row using HTML Table Class - by El Forum - 08-30-2009, 05:22 AM
add css class to current row using HTML Table Class - by El Forum - 08-30-2009, 05:36 AM
add css class to current row using HTML Table Class - by El Forum - 08-30-2009, 09:22 AM
add css class to current row using HTML Table Class - by El Forum - 08-30-2009, 10:42 AM
add css class to current row using HTML Table Class - by El Forum - 08-30-2009, 10:47 AM
add css class to current row using HTML Table Class - by El Forum - 08-30-2009, 10:06 PM
add css class to current row using HTML Table Class - by El Forum - 08-31-2009, 09:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB