removing and re-populating boostrapTable

Daniel Sh.

I want basically to refresh the data held in a table. First instantiation works just fine, but no luck after removing and re-fetching of the data.

html

<table id="tablePendByOrg" class="table table-bordered table-hover table-condensed table-striped">
                        <thead>
                            <tr>
                                <th data-field="Date">Time</th>
                                <th data-field="Organization">Org</th>
                                <th data-field="f24hs"><24Hs</th>
                                <th data-field="f48Hs"><48Hs</th>
                                <th data-field="f48Hs">>48Hs</th>
                                <th data-field="fTotal">Total</th>
                            </tr>
                        </thead>
                    </table>

js to populate after ajax call.

$('#tablePendByOrg').bootstrapTable({        
    data: d.Table
});

js to remove data

$("#tablePendByOrg tbody tr").remove();

And after a new call to the ajax code, I get the proper data in d.Table but no tbody are showing on the page, just the framed th that I set from the get go.

bluehipy

As they describe:

$table = $('#tablePendByOrg');
$table.bootstrapTable('load', data); // removes old data, no need to remove it by yourself

also the removal o all items is not to be done as you did:

$("#tablePendByOrg tbody tr").remove();

use:

$table.bootstrapTable('removeAll');

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Re-populating form field

From Dev

Re-populating form field

From Dev

Update GridView/ListView without re-populating

From Dev

Removing a fragment and then re-adding it

From Dev

CodeIgniter's set_value() not re-populating

From Dev

Re-populating radio buttons and selection option in a form

From Dev

Removing/Re-adding filter options

From Dev

Trouble with removing and re-indexing array

From Dev

Removing parent elements and re-appending children

From Dev

re-populating a tableview with new array elements when a cell is clicked in swift

From Dev

Why is my redirectAttributes.addFlashAttribute and data Re-populating not working after validation fails?

From Dev

Re-populating checkboxlist in a GridView from SQL comma-separated string

From Dev

RecyclerView not populating the first time I enter the activity but showing after i exit and re-enter the activity

From Dev

Removing the Allow Null check box ,, require the table to be re-created

From Dev

Removing and re-adding a CSS property changes element's position

From Dev

Efficiently re-arrange a List<Object> after removing X objects

From Dev

Removing options from select and re-appending changes selected

From Dev

Removing elements of array causes multiple re-renders

From Dev

Efficiently re-arrange a List<Object> after removing X objects

From Dev

Adding/removing summaries/plots requires re-compilation of runjags object

From Dev

Removing OEM version of Windows, and re-installing in VM

From Dev

Retain getChildFragmentManager navigation stack after removing and re-adding fragment

From Dev

Removing empty strings from a re.findall command

From Dev

Form Validation & Re-Populating Field Values After Redirect Error; Validation Works, But Values Doesn't (CodeIgniter 3)

From Dev

Populating checkboxes

From Dev

Populating ArrayList

From Dev

NSMutableArray not populating

From Dev

$routeParams not populating

From Dev

Populating RibbonComboBox

Related Related

  1. 1

    Re-populating form field

  2. 2

    Re-populating form field

  3. 3

    Update GridView/ListView without re-populating

  4. 4

    Removing a fragment and then re-adding it

  5. 5

    CodeIgniter's set_value() not re-populating

  6. 6

    Re-populating radio buttons and selection option in a form

  7. 7

    Removing/Re-adding filter options

  8. 8

    Trouble with removing and re-indexing array

  9. 9

    Removing parent elements and re-appending children

  10. 10

    re-populating a tableview with new array elements when a cell is clicked in swift

  11. 11

    Why is my redirectAttributes.addFlashAttribute and data Re-populating not working after validation fails?

  12. 12

    Re-populating checkboxlist in a GridView from SQL comma-separated string

  13. 13

    RecyclerView not populating the first time I enter the activity but showing after i exit and re-enter the activity

  14. 14

    Removing the Allow Null check box ,, require the table to be re-created

  15. 15

    Removing and re-adding a CSS property changes element's position

  16. 16

    Efficiently re-arrange a List<Object> after removing X objects

  17. 17

    Removing options from select and re-appending changes selected

  18. 18

    Removing elements of array causes multiple re-renders

  19. 19

    Efficiently re-arrange a List<Object> after removing X objects

  20. 20

    Adding/removing summaries/plots requires re-compilation of runjags object

  21. 21

    Removing OEM version of Windows, and re-installing in VM

  22. 22

    Retain getChildFragmentManager navigation stack after removing and re-adding fragment

  23. 23

    Removing empty strings from a re.findall command

  24. 24

    Form Validation & Re-Populating Field Values After Redirect Error; Validation Works, But Values Doesn't (CodeIgniter 3)

  25. 25

    Populating checkboxes

  26. 26

    Populating ArrayList

  27. 27

    NSMutableArray not populating

  28. 28

    $routeParams not populating

  29. 29

    Populating RibbonComboBox

HotTag

Archive