$ajax not. function,n.ajax is not a function

localhost example not working.

Uncaught TypeError: n.ajax is not a function jquery-3.3.1.slim.min.js:2

at t.value (bootstrap-table.min.js:10)

at t.value (bootstrap-table.min.js:10)

at new t (bootstrap-table.min.js:10)

at HTMLTableElement. (bootstrap-table.min.js:10)

at Function.each (jquery-3.3.1.slim.min.js:2)

at w.fn.init.each (jquery-3.3.1.slim.min.js:2)

at w.fn.init.n.fn.bootstrapTable (bootstrap-table.min.js:10)

at initTable ((index):150)

at HTMLDocument. ((index):244)

at l (jquery-3.3.1.slim.min.js:2)

`

Welcome to guest book


{{ csrf_field() }}

Ваше имя

Ваше телефон

Ваш E-mail

Ваша WWW страница.

Сообщение

Добавить коментарий


id="table"

data-toggle="table"

data-url="https://examples.wenzhixin.net.cn/examples/bootstrap_table/data"

data-pagination="true"

data-side-pagination="server"

data-search="true"

data-page-list="[10, 25, 50, 100, ALL]">

var $table = $('#table')

var $remove = $('#remove')

var selections = []

function getIdSelections() {

return $.map($table.bootstrapTable('getSelections'), function (row) {

return row.id

})

}

function responseHandler(res) {

$.each(res.rows, function (i, row) {

row.state = $.inArray(row.id, selections) !== -1

})

return res

}

function detailFormatter(index, row) {

var html = []

$.each(row, function (key, value) {

html.push('

' + key + ': ' + value + '

')

})

return html.join('')

}

function operateFormatter(value, row, index) {

return [

'

'',

' ',

'',

'',

''

].join('')

}

window.operateEvents = {

'click .like': function (e, value, row, index) {

alert('You click like action, row: ' + JSON.stringify(row))

},

'click .remove': function (e, value, row, index) {

$table.bootstrapTable('remove', {

field: 'id',

values: [row.id]

})

}

}

function totalTextFormatter(data) {

return 'Total'

}

function totalNameFormatter(data) {

return data.length

}

function totalPriceFormatter(data) {

var total = 0

$.each(data, function (i, row) {

total += +(row.price.substring(1))

})

return '$' + total

}

function initTable() {

$table.bootstrapTable({

height: 500,

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_) {

var 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')

var index = $(this).parents('tr').data('index')

console.log(data[index])

return ''

}

},

footerFormatter: totalPriceFormatter

}, {

field: 'operate',

title: 'Item Operate',

align: 'center',

events: window.operateEvents,

formatter: operateFormatter

}]

]

})

$table.on('check.bs.table uncheck.bs.table ' +

'check-all.bs.table uncheck-all.bs.table',

function () {

$remove.prop('disabled', !$table.bootstrapTable('getSelections').length)

// save your data, here just save the current page

selections = getIdSelections()

// push or splice the selections if you want to save all data selections

})

$table.on('expand-row.bs.table', function (e, index, row, $detail) {

if (index % 2 === 1) {

$detail.html('Loading from ajax request...')

$.get('LICENSE', function (res) {

$detail.html(res.replace(/\n/g, '
'))

})

}

})

$table.on('all.bs.table', function (e, name, args) {

console.log(name, args)

})

$remove.click(function () {

var ids = getIdSelections()

$table.bootstrapTable('remove', {

field: 'id',

values: ids

})

$remove.prop('disabled', true)

})

}

$(function() {

initTable()

})

© Company 2017-2018

`

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值