I am starting to learn javascript.
Controller file:
public function index(){
$this->load->view('crud_view.php');
$this->load->model('pushnotification_model');
$data['jsonData'] = json_encode($this->pushnotification_model->search_user());
$this->load->view('pushnotification_group_wise_view',$data);
}
search_user is a method in the model pushnotification_model which retrieves data from the database and returns back to the controller for json encoding.
Now in the pushnotification_group_wise_view I have a table like below:
<div id="showUserData" data-bind="visible: records().length > 0">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>GCM REG ID</th>
<th>EBL SKY ID</th>
<th style="text-align:center"><button data-bind="click :$root.processAll" class="btn btn-primary">Select All</button></th>
</tr>
</thead>
<tbody data-bind="foreach: records">
<tr>
<td data-bind="text:gcm_regid"></td>
<td data-bind="text:eblSkyId"></td>
<td style="text-align:center"><input type="checkbox" data-bind="checked: isProcessed"></td>
</tr>
</tbody>
</table>
Now I want to populate the table with the $data using javascript. How can I do that?