Created
August 17, 2017 14:43
-
-
Save craigerskine/cecbee27d525553b340762f94c9336d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
// table | |
var table_data = [ | |
{ | |
name: '<a href="#">Some name</a>', | |
id: '1' | |
} | |
] | |
$('#table-bootstrap').bootstrapTable({ | |
data: table_data, | |
iconsPrefix: 'fa', | |
icons: { | |
paginationSwitchDown: 'fa-chevron-down', | |
paginationSwitchUp: 'fa-chevron-up', | |
refresh: 'fa-refresh', | |
toggle: 'fa-list-alt', | |
columns: 'fa-columns', | |
detailOpen: 'fa-plus', | |
detailClose: 'fa-minus' | |
} | |
}).on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function(){ | |
$('#remove').prop('disabled', !$(this).bootstrapTable('getSelections').length); | |
}); | |
$('#remove').click(function(){ | |
var ids = $.map($('#table-bootstrap').bootstrapTable('getSelections'), function(row){ | |
return row.id | |
}); | |
$('#table-bootstrap').bootstrapTable('remove', { | |
field: 'id', | |
values: ids | |
}); | |
$('#remove').prop('disabled', true); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment