Skip to content

Commit

Permalink
Adding javascript for data-confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Favetti committed Feb 10, 2016
1 parent d49e136 commit caea84d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
14 changes: 11 additions & 3 deletions application/views/admin/labels/labelsets_view.php
Expand Up @@ -69,11 +69,19 @@

</div>

<!-- To update rows per page via ajax -->
<script type="text/javascript">
jQuery(function($) {
jQuery(document).on("change", '#pageSize', function(){
$.fn.yiiGridView.update('labelsets-grid',{ data:{ pageSize: $(this).val() }});
// To update rows per page via ajax
$(document).on("change", '#pageSize', function() {
$.fn.yiiGridView.update('labelsets-grid',{ data:{ pageSize: $(this).val() }});
});
//Delete button
$(document).ready(function() {
$('a[data-confirm]').click(function() {
if (!confirm($(this).attr('data-confirm'))) {
return false;
}
});
});
});
</script>
14 changes: 11 additions & 3 deletions application/views/admin/usergroup/usergroups_view.php
Expand Up @@ -83,11 +83,19 @@

</div>

<!-- To update rows per page via ajax -->
<script type="text/javascript">
jQuery(function($) {
jQuery(document).on("change", '#pageSize', function(){
$.fn.yiiGridView.update('usergroups-grid',{ data:{ pageSize: $(this).val() }});
// To update rows per page via ajax
$(document).on("change", '#pageSize', function() {
$.fn.yiiGridView.update('usergroups-grid',{ data:{ pageSize: $(this).val() }});
});
//Delete button
$(document).ready(function() {
$('a[data-confirm]').click(function() {
if (!confirm($(this).attr('data-confirm'))) {
return false;
}
});
});
});
</script>

0 comments on commit caea84d

Please sign in to comment.