Bootstrap-table: How can I UpdateCell by UniqueId, instead of Row Index

Created on 11 Sep 2017  路  4Comments  路  Source: wenzhixin/bootstrap-table

Hello,

I need to update a cell based on some run time logic, not triggered by row click event, so I don't have row index.

All I have is UniqueId.

Basically, "getRowByUniqueId" does not return row index, and "updateCell" needs row index.

It doesn't seem every efficient to use "getRowByUniqueId" to get the row data, then use "updateByUniqueId" to copy every column not changed, except one column with new value.

Any suggestions?

Any help greatly appreciated!

help-wanted

Most helpful comment

Hi @wenzhixin , current version v1.11.1 does not have "updateCellById", where can I get it?
Thanks!

All 4 comments

Hello,

You don't need to pass all column values in "updateByUniqueId".

You can just do:

table.bootstrapTable('updateByUniqueId', {
id: ID,
row: {FIELD: VALUE}
});

@luisbessa , Wow, thanks much!
Will try out your solution shortly!

updateCellById method can solve your problem.

Hi @wenzhixin , current version v1.11.1 does not have "updateCellById", where can I get it?
Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

simkeyur picture simkeyur  路  19Comments

iamthestreets picture iamthestreets  路  26Comments

gadget00 picture gadget00  路  16Comments

DavidKrupi picture DavidKrupi  路  23Comments

antonioaltamura picture antonioaltamura  路  15Comments