menu import and exp update

This commit is contained in:
Yan
2018-04-02 15:59:36 +06:30
parent 3ee12df0bc
commit c176b41e79
9 changed files with 291 additions and 120 deletions

View File

@@ -62,9 +62,12 @@
<!-- <td><%= settings_menu.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td> -->
<td>
<%= link_to t("views.btn.edit"), edit_settings_menu_path(settings_menu),:class => 'btn btn-info btn-sm waves-effect' %>
</td>
</tr>
<% end %>
<a href="#" id="export-xlsx" data-attr="<%= settings_menu.id %>" class="btn btn-primary btn-sm waves-effect" style="height: 33px;">
<i class="material-icons" style="top: 0px;">backup</i>
</a>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
@@ -101,3 +104,21 @@
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#export-xlsx").on('click', function(){
var menu_id= $(this).attr('data-attr');
console.log(menu_id);
$.ajax({
type: "GET",
url: "/settings/menus/" + menu_id + "/export",
success: function(result){
if(result.status){
swal("Success", "Export Success...", "success");
}
}
});
});
});
</script>