Skip to content

Multiple tables on same page #7

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

HSystem
Copy link

@HSystem HSystem commented Apr 13, 2014

Here is an example of multiple stream_tables on same page. The example closely resembles the stream.html example, but it has the initial HTML for two tables. It requires that the HTML has uniqueIds for elements. If both tables contain same columns, one template can be utilized. Also a few slight modifications to the stream_table.js were necessary in order to have the paging/searching work as intended. I hope you can review this, and merge it back to the project?

HSystem added 4 commits April 13, 2014 16:40
An example and corresponding edits to stream_table.js to be able to use
multiple StreamTable.js on one page
The progress indicator was removed when first one hit 2000.
The new selector is slightly more restrictive, in case somebody has
.active in container for other purposes.
@HSystem HSystem closed this Apr 13, 2014
@HSystem
Copy link
Author

HSystem commented Apr 13, 2014

There is actually still a small bug, that breaks the original stream.html example. (In a case where search_box hasn't been given an id in initialization. I'll look into fixing it, and submitting a new pull request once fixed.

As my code prepends a '#' to the search_box id later on, this caused
issues (double ##) when search_box wasn't provided in initialization
parameter as in multiple.html-example. Now fixed.
@HSystem HSystem reopened this Apr 13, 2014
@HSystem
Copy link
Author

HSystem commented Apr 13, 2014

Now fixed. Tested with original examples: index.html, sorting.html, stream.html as well as new multiple.html. All worked.

};

_F.bindEvents = function(){
var _self = this,
search_box = this.opts.search_box;
search_box = '#'+this.opts.search_box;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not the maintainer on this, but as a user, I'd much rather be able to provide any jQuery selector and not be constrained to an ID.

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

Successfully merging this pull request may close these issues.

2 participants