Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var $table = $('#table'),
- $remove = $('#remove'),
- selections = [];
- function initTable() {
- $table.bootstrapTable({
- height: getHeight(),
- columns: [
- [
- {
- field: 'state',
- checkbox: true,
- rowspan: 2,
- align: 'center',
- valign: 'middle'
- }, {
- title: 'Item ID',
- field: 'id',
- rowspan: 2,
- align: 'center',
- valign: 'middle',
- sortable: true,
- footerFormatter: totalTextFormatter
- }, {
- title: 'Item Detail',
- colspan: 3,
- align: 'center'
- }
- ],
- [
- {
- field: 'name',
- title: 'Item Name',
- sortable: true,
- editable: true,
- footerFormatter: totalNameFormatter,
- align: 'center'
- }, {
- field: 'price',
- title: 'Item Price',
- sortable: true,
- align: 'center',
- editable: {
- type: 'text',
- title: 'Item Price',
- validate: function (value) {
- value = $.trim(value);
- if (!value) {
- return 'This field is required';
- }
- if (!/^$/.test(value)) {
- return 'This field needs to start width $.'
- }
- var data = $table.bootstrapTable('getData'),
- index = $(this).parents('tr').data('index');
- console.log(data[index]);
- return '';
- }
- },
- footerFormatter: totalPriceFormatter
- }, {
- field: 'operate',
- title: 'Item Operate',
- align: 'center',
- events: operateEvents,
- formatter: operateFormatter
- }
- ]
- ]
- });
- var $table = $('#table');
- $table.bootstrapTable({...});
- $.prototype.nomeDeUmaFuncao = function() { console.log('teste nova custom function do JQuery'); };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement