question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Table not updating when formatter is setted

See original GitHub issue

My column setting are these:

columns = {
    dataField: 'inexistentField',
    text: "Obj state",
    formatter: (cell, obj) => {
        console.log('Obj -> ', obj); // Only executed when on table change function is executed by table
    }
}

Table does not update when I call my tableChange function (one that is passed down to onTableChange) externally (not using one of the page buttons).

When I click on any sortable column, content generated by formatter function changes normally. If data changes a lot (for instance, with different number of elements) table works fine. I’ve debugged with React Dev Tools and my state and table props are correct.

Version bootstrap-table: 1.3.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Genaritocommented, Oct 31, 2018

How could I define dinamyc data on one column? For instance, given a value in one of my obj’s field, show a specific icon? Because if formatter can’t manage dinamyc data and formatExtraData doesn’t receive the current row, I have no idea how we could solve a problem like that one.

Thanks in advance

1reaction
waynebrantleycommented, Dec 3, 2018

@jkrawczyk What is not documented yet is that the grid needs you to treat the data as immutable, much like redux requires. This way it knows what to redraw, etc. I have modified your example not to directly mutate state and it works as expected. https://github.com/react-bootstrap-table/react-bootstrap-table2/issues/656#issuecomment-443488050

https://codesandbox.io/s/v8pz48rl30

Read more comments on GitHub >

github_iconTop Results From Across the Web

Formatter not called after table refresh - sapui5 - Stack Overflow
Once I refresh the model, the list is being updated, and my custom formatter ... Set the model to the table and call...
Read more >
Linked Excel table with preserve formatting doesn't update
I think I have found a bug in the current version of Word 365. If you have a linked excel and preserve formatting...
Read more >
Excel table not formatting new rows appropriately - Super User
To resolve this click on the header of a column then right click and choose "Format Cells" option and set the desired format....
Read more >
Why Excel Table Number Formatting Doesn't Copy Down and ...
All Cells in the Column Must Be Formatted at the Same Time ... The reason this happens is because the number formatting was...
Read more >
Conditional formatting not updating | MrExcel Message Board
BUT for some of the cells I need to set custom format to ;;; (to hide the text form users.. this cannot be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found