wenzhixin / bootstrap-table-examples

Bootstrap table examples
https://examples.bootstrap-table.com/
MIT License
2.24k stars 1.62k forks source link

Bootstrap Tables Set Checkbox marked as Checked #324

Closed Division4Studios closed 6 years ago

Division4Studios commented 6 years ago

I am using Bootstrap Tables. Documentation Located Here

I am using Pagination on a large amount of dynamically generated data from a MySQL server. I am using checkboxes at the beginning of the table, however I need a way to sample the hundreds of entries and then pre-checkmark a few of these entries based off existing data.

I have tried using $("#storeTable").bootstrapTable('getData', false); To be able to cycle through all of the entries and check them using a post table load method, however this only returns the 10 or so rows that are displayed in pagination.

Any help here on a fix or a strategy to accomplish this would be nice. It would also be nice if after checking them I could get the checked ones to sort to the top.

`

<div id="@ViewData["Title"]" class="table-responsive text-nowrap" style="white-space:normal; overflow-x:scroll">

@foreach (var item in Model.dealeradminstore) { }
@Html.DisplayNameFor(model => model.dealeradminstore[0].cg) @Html.DisplayNameFor(model => model.dealeradminstore[0].serial_number) @Html.DisplayNameFor(model => model.dealeradminstore[0].Name) WebReports
@test.NullRefExcl(item.cg.ToString()) @test.NullRefExcl(item.serial_number.ToString()) @test.NullRefExcl(item.Name) @{string reportsCheck = ""; if (test.NullRefExcl(item.base_xtags).Contains("RPT")) { reportsCheck = "Yes"; } if (!test.NullRefExcl(item.base_xtags).Contains("RPT")) { reportsCheck = "No"; } } @test.NullRefExcl(reportsCheck)
            </div>
        </div>`