OB
Asked
I need help with Adding a Column in Purchases datagridview. I read the instruction manual and I got the process but when I add the new columns look like they don't docent appear in the datagridview.
I did the changes in Index.php and the changes in the Purchases.php too.
PHP CODE::::::::::::::::::
PURCHASES.PHP>>>>>>
$this->load->library('datatables');
if ($warehouse_id) {
$this->datatables
->select("id, DATE_FORMAT(date, '%Y-%m-%d %T') as date, reference_no, container_number, port_of_loading, port_of_discharge,
supplier, status, grand_total, paid, (grand_total-paid) as balance, payment_status, attachment")
->from('purchases')
->where('warehouse_id', $warehouse_id);
} else {
$this->datatables
->select("id, DATE_FORMAT(date, '%Y-%m-%d %T') as date, reference_no, container_number, port_of_loading, port_of_discharge,
supplier, status, grand_total, paid, (grand_total-paid) as balance, payment_status, attachment")
->from('purchases');
}
INDEX.PHP>>>>>>
<thead>
<tr class="active">
<th style="min-width:30px; width: 30px; text-align: center;">
<input class="checkbox checkft" type="checkbox" name="check"/>
</th>
<th><?= lang('date'); ?></th>
<th><?= lang('ref_no'); ?></th>
<th><?= lang('Container_Number'); ?></th>
<th><?= lang('port_of_loading'); ?></th>
<th><?= lang('port_of_discharge'); ?></th>
<th><?= lang('supplier'); ?></th>
<th><?= lang('purchase_status'); ?></th>
<th><?= lang('grand_total'); ?></th>
<th><?= lang('paid'); ?></th>
<th><?= lang('balance'); ?></th>
<th><?= lang('payment_status'); ?></th>
<th style="min-width:30px; width: 30px; text-align: center;"><i class="fa fa-chain"></i></th>
<th style="width:100px;"><?= lang('actions'); ?></th>
</tr>
</thead>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<tfoot class="dtFilter">
<tr class="active">
<th style="min-width:30px; width: 30px; text-align: center;">
<input class="checkbox checkft" type="checkbox" name="check"/>
</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th><?= lang('grand_total'); ?></th>
<th><?= lang('paid'); ?></th>
<th><?= lang('balance'); ?></th>
<th></th>
<th style="min-width:30px; width: 30px; text-align: center;"><i class="fa fa-chain"></i></th>
<th style="width:100px; text-align: center;"><?= lang('actions'); ?></th>
</tr>
</tfoot>
I don't know what is missing. can you help me please. I will appreciate it'
I did the changes in Index.php and the changes in the Purchases.php too.
PHP CODE::::::::::::::::::
PURCHASES.PHP>>>>>>
$this->load->library('datatables');
if ($warehouse_id) {
$this->datatables
->select("id, DATE_FORMAT(date, '%Y-%m-%d %T') as date, reference_no, container_number, port_of_loading, port_of_discharge,
supplier, status, grand_total, paid, (grand_total-paid) as balance, payment_status, attachment")
->from('purchases')
->where('warehouse_id', $warehouse_id);
} else {
$this->datatables
->select("id, DATE_FORMAT(date, '%Y-%m-%d %T') as date, reference_no, container_number, port_of_loading, port_of_discharge,
supplier, status, grand_total, paid, (grand_total-paid) as balance, payment_status, attachment")
->from('purchases');
}
INDEX.PHP>>>>>>
<thead>
<tr class="active">
<th style="min-width:30px; width: 30px; text-align: center;">
<input class="checkbox checkft" type="checkbox" name="check"/>
</th>
<th><?= lang('date'); ?></th>
<th><?= lang('ref_no'); ?></th>
<th><?= lang('Container_Number'); ?></th>
<th><?= lang('port_of_loading'); ?></th>
<th><?= lang('port_of_discharge'); ?></th>
<th><?= lang('supplier'); ?></th>
<th><?= lang('purchase_status'); ?></th>
<th><?= lang('grand_total'); ?></th>
<th><?= lang('paid'); ?></th>
<th><?= lang('balance'); ?></th>
<th><?= lang('payment_status'); ?></th>
<th style="min-width:30px; width: 30px; text-align: center;"><i class="fa fa-chain"></i></th>
<th style="width:100px;"><?= lang('actions'); ?></th>
</tr>
</thead>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<tfoot class="dtFilter">
<tr class="active">
<th style="min-width:30px; width: 30px; text-align: center;">
<input class="checkbox checkft" type="checkbox" name="check"/>
</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th><?= lang('grand_total'); ?></th>
<th><?= lang('paid'); ?></th>
<th><?= lang('balance'); ?></th>
<th></th>
<th style="min-width:30px; width: 30px; text-align: center;"><i class="fa fa-chain"></i></th>
<th style="width:100px; text-align: center;"><?= lang('actions'); ?></th>
</tr>
</tfoot>
I don't know what is missing. can you help me please. I will appreciate it'
- OBAnsweredThis is the PictureAttachments
- OBAnsweredPicture two.Attachments
- MSAnsweredHello,
You need to update the `aoColumns` for `dataTable` in the view file `index.php`
Thank you - OBAnsweredBut I loss the color Icon. Paid Pending
- OBAnswereddo you know where I can find the aoColumns Set up. so I can try to make the changes. because I see I losing a lot action and Icon in the screen. now I have # 1 instep the Check Mark.
- OBAnsweredI loss my CSV Report and that is so important to me. !!!
- MSAnsweredHello,
The `aoColumns` option in the initialisation parameter allows you to define details about the way individual columns behave. You can search the `index.php`
I didn't understand how you loss the report? If you modified any file then please reset it back. If you are not developer, please hire any developer to add the columns for you.
Thank you - OBAnsweredI did the correction, the only thing was to add more NULLs to the Index. php now is working fine. thanks you for your help you give a clue with your answer.
EX=>
"aoColumns": [{"bSortable": false,"mRender": checkbox}, {"mRender": fld},
null, null, null, null, null, null, null, null, {"mRender": row_status}, {"mRender": currencyFormat}, {"mRender": currencyFormat},
{"mRender": currencyFormat}, {"mRender": pay_status}, {"bSortable": false,"mRender": attachment},
{"bSortable": false}],
'fnRowCallback': function (nRow, aData, iDisplayIndex) { - MSAnsweredI am glad that you have managed it.
- Login to Reply