Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paging 'size' not working #333

Closed
x2rider opened this issue Jul 10, 2015 · 4 comments
Closed

Paging 'size' not working #333

x2rider opened this issue Jul 10, 2015 · 4 comments

Comments

@x2rider
Copy link

x2rider commented Jul 10, 2015

I'm using Footable V3 and the paging is enabled, but the table is not honoring the size parameter. The table ends up showing all the rows of the data. The paging buttons do come up, but they do nothing. Also, the filtering doesn't seem to work, so I would like to see an example of that.

Here is the code:

<table id="peopleTable" class="footable table table-hover table-striped" data-page-size="11" style="width: 90%; font-size: 10px;">
    <thead>
        <tr>
            <th data-sort-ignore="true" data-filter-ignore="true"></th>
            <th>Name</th>
            <th>User Id</th>
        </tr>
    </thead>
 <tbody>
</tbody>
</table>

$('.footable').footable({
stopPropagation: true,
ajaxEnabled: true,
sorting: { enabled: false },
paging: {
    enabled: true,
    size: 5,
    current: parseInt(FooTable.getURLParameter('page')) || 1
},
columns: {
    0: {
        name: 'Id', title: '', width: 30, sortable: false, pk: true, filterable: false,
        formatter: function (value) {
            var content = "<i class='fa fa-trash deleteme' id='del-" + value + "' style='color: #ff0000; cursor: pointer; font-size:medium;'> </i>";
            return content;
        }
    },
    1: { name: 'DisplayName', title: 'Name', sortable: true, filterable: true },
    2: { name: 'UserId', title: 'User Id', sortable: true, filterable: true }
},
filtering: {
    enabled: true,
    min: 3,
    columns: [
        "DisplayName",
        "UserId"
    ]
},
on: {
    click: function (e) {
        // do something whenever the table is clicked
        // ... code to do actions when clicking on rows or delete icon (removed)
    }
},
ajax: function (requestData) {
    // Do what you need to do with the FooTable.RequestData to initiate an ajax call to the server
    var peopleURL = '[API_SERVER_URL]';

    return $.ajax({
        type: 'GET',
        dataType: 'JSON',
        url: peopleURL,
        data: requestData
    }).then(function (response) {
        // On success massage the server response into one that FooTable can recognize (The FooTable.ResponseData object)
        return {
            totalRows: response.length,
            rows: response
        };
    });
}
});
@x2rider
Copy link
Author

x2rider commented Jul 15, 2015

Any thoughts? Am I doing something wrong? I'm going to have to investigate other options at this point.

@x2rider
Copy link
Author

x2rider commented Jul 15, 2015

I changed to using jquery.dataTables, and got the job done. I hope V3 works someday.

@steveush
Copy link
Member

Resolved in release 3.0.2.

@jester6san
Copy link

it's not fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants