I've got a table pulling from my MySQL database. I want to click on view and a modal window pop up w/ notes from the database.
I've seen a couple solutions online, but can't get any to work with Codeigniter.
Controller with link to modal window:
public function tableload_location_notes()
{
$this->load->database();
$this->load->library('Datatables');
$this->datatables->select('
VENDORLOCATIONNOTES.ID,
VENDORLOCATIONNOTES.ADDEDBY,
VENDORLOCATIONNOTES.DATEADDED,
VENDORLOCATIONNOTES.NOTES
', FALSE);
$this->datatables->from('VENDORLOCATIONNOTES');
$this->datatables->where('VENDORLOCATIONNOTES.LOCATIONID', $this->uri->segment(4));
$this->datatables->add_column('edit', '<a href="#" data-toggle="modal" data-target="#viewnoteModal" data-id="1">view</a>', 'ID');
echo $this->datatables->generate();
}
View with the actual modal script:
<div class="modal fade" id="viewnoteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">View Location Note</h4>
</div>
<div class="modal-body"></div>
</div>
</div>
</div>
That will open up my modal, but I don't know how to show the notes that I'm pulling from the database.