bootstrap-table: Doesnt load the table: Uncaught TypeError: Cannot convert object to primitive value

Hi all,

I haven’t been able to load any kind of bootstrap-table code. Not even the examples on the website. I keep getting the same javascript error:

bootstrap-table.min.js:10 Uncaught TypeError: Cannot convert object to primitive value
    at Object.setFieldIndex (bootstrap-table.min.js:10)
    at e.value (bootstrap-table.min.js:10)
    at e.value (bootstrap-table.min.js:10)
    at new e (bootstrap-table.min.js:10)
    at HTMLTableElement.<anonymous> (bootstrap-table.min.js:10)
    at Function.each (jquery.min.js:2)
    at w.fn.init.each (jquery.min.js:2)
    at w.fn.init.t.fn.bootstrapTable (bootstrap-table.min.js:10)

My dependencies are correct; the jquery and the bootstrap library load well in the browser from the CDNs(otherwise it wouldnt recognize them here).
Im using version 1.15 I am using W10, and Chrome 76.0.3809.100 .

Please, any help would be appreciated

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

I have the same problem and I think the right solution for it will be to take jquery@3.4.1 like it’s stated in bootstrap 4.4 documentation.

thanks a lot @StanislavNemytov, I had jquery 3.50…I lost many hours try to fix my issue…I take jquery@3.4.1 and it’s works

Fixed in #4634

@wenzhixin 刚尝试把这个案例单独提出来时发现居然又是正常的, 不知道是不是因为我的工程中有其他js库跟它有冲突, 而且我发现在工程中,当我使用 min版本(即bootstrap-table-min.js)时会有这个问题,换成非min版本又是正常的, 待我再尝试其他方式排查一下,有消息再反馈。

另:反馈一个现象不知是否BUG, 就是当我把bt升级为1.15.4时,原表格各列的宽度完全失控了,经排查发现,原来设定的 colums中的 width 失效了, 具体情况为 设置为 px单位正常, 设置为百分比单位时,全部被转成了 px单位, 如我设置其中某一列width 为 15%,渲染到页面时变成了 15px, 烦请核实!

我也遇到了一样的问题, 用的1.15.4版本, 原来用的1.12.x版本正常, MacOS 10.14.6 Chrom 76.0.3809.100(正式版本) (64 位)

Uncaught TypeError: Cannot convert object to primitive value at Object.setFieldIndex (bootstrap-table.min.js:10) at e.value (bootstrap-table.min.js:10) at e.value (bootstrap-table.min.js:10) at new e (bootstrap-table.min.js:10) at HTMLTableElement.<anonymous> (bootstrap-table.min.js:10) at Function.each (jquery.min.js:2) at k.fn.init.each (jquery.min.js:2) at k.fn.init.t.fn.bootstrapTable (bootstrap-table.min.js:10) at k.fn.init.createTable (ceec.core.js?v=1.1.0.19040802:392) at ln.taskList (<anonymous>:127:32)

参数如下:

{
	"idField": "id",
	"striped": true,
	"sidePagination": "server",
	"pagination": true,
	"toolbar": "#toolbar",
	"url": "/ceec-web-console/console/taskinfo/list?taskName=&status=",
	"columns": [{
		"field": "state",
		"checkbox": "taskId"
	}, {
		"field": "taskName",
		"title": "标题",
		"halign": "left",
		"width": "25%"
	}, {
		"field": "sender",
		"title": "创建人",
		"halign": "left"
	}, {
		"field": "stTime",
		"title": "发起时间",
		"halign": "left"
	}, {
		"field": "edTime",
		"title": "截止日期",
		"halign": "left"
	}, {
		"field": "completionStatus",
		"title": "执行情况",
		"halign": "left"
	}, {
		"field": "status",
		"title": "任务状态",
		"halign": "left"
	}, {
		"field": "step",
		"title": "任务进度(%)",
		"halign": "left"
	}, {
		"field": "taskId",
		"title": "操作"
	}],
	"height": 750,
	"pageSize": 15
}

@gadget00 兄弟的问题有没有解决 @wenzhixin 请求支持

排版实再折腾了,将就点看吧