Question: More Colums Expenses

More Colums Expenses

Hello I Wand to Add more Colums in Expenses. (Attachments). I edited in the File Purcheses.php for functional _____________________________________________________________________________

DK

Duy Khanh

Asked

Hello I Wand to Add more Colums in Expenses. (Attachments). I edited in the File Purcheses.php for functional


$dakiemtra = '<div class="text-center"><div class="btn-group text-left">'
    . '<button type="button" class="btn btn-default btn-xs btn-primary dropdown-toggle" '
    . lang('dakiemtra') . ' <span class="caret"></span></button>
</div></div>';
	$doanhnghiep = '<div class="text-center"><div class="btn-group text-left">'
    . '<button type="button" class="btn btn-default btn-xs btn-primary dropdown-toggle" '
    . lang('doanhnghiep') . ' <span class="caret"></span></button>
</div></div>';

    $this->load->library('datatables');

    $this->datatables
        ->select($this->db->dbprefix('expenses') . ".id as id, date,reference, {$this->db->dbprefix('expense_categories')}.name as category, amount, note, dakiemtra,doanhnghiep",false)
        ->from('expenses')
        ->join('expense_categories', 'expense_categories.id=expenses.category_id', 'left')
        ->group_by('expenses.id');
		$this->datatables->add_column('Actions', $action, 'id');
		$this->datatables->add_column('dakiemtra', $dakiemtra, 'dakiemtra');
		$this->datatables->add_column('doanhnghiep', $doanhnghiep, 'doanhnghiep');

and edited the Templates, every things fine but Itsn’t show corectly at colums " $doanhnghiep" It’s the Attachment colums, so it show the Link for download.

Thank you for Support

  • MS

    Mian Saleem

    Answered

    Hello,

    You are adding the column after actions, move it up and then check the view file again. You have add the column to aoColumns for datatables and the th/td in thead/tfoot for the html table. If you are not sure, please hire any developer to help you add the column.

    Thank you

  • DK

    Duy Khanh

    Answered

    done! Thank you very much

  • Login to Reply