Answers for "datatables editcolumn if else"

0

datatables editcolumn if else

$data = $this->SourceData->getData();

return Datatables::of($data)
        ->addIndexColumn()
        ->editColumn('show', function ($data) {
            return  ($data->show == 'y')?"Yes":($data->show == 'n')?"No":"";
        })
        ->addColumn('Actions', function($data) {...})
        ->rawColumns(['Actions'])
        ->make(true);
Posted by: Guest on October-30-2020
0

datatables editcolumn if else

"createdRow": function (row, data) {

          $('td', row).eq('COLUMN_INDEX_HERE').html($('<label>').attr({
              class:  (data.status == 0) ? 'label label-warning' : ( (data.status == 1) ? 'label label-success': 'label label-danger' )
          }).html((data.status == 0) ? 'Pending' : ( (data.status == 1) ? 'Approved': 'Canceled' )));

            }
Posted by: Guest on October-30-2020

Browse Popular Code Answers by Language