base icon indicating copy to clipboard operation
base copied to clipboard

Improved List View

Open rgstephens opened this issue 8 years ago • 11 comments

Has there been any discussion about an improved list view with pagination, sorting, filtering, etc?

I've been adding the React grid component Griddle to most of my projects built with Base to add these features. I'm starting a new project with latest Base (thanks for all the great improvement in the past few releases) and Griddle is one of the first components I add. I haven't surveyed other options for this functionality in the past few months so maybe there's sometime better.

I install:

meteor npm install griddle-react --save

rgstephens avatar Dec 28 '16 20:12 rgstephens

Hi @rgstephens. Not specifically. The goal of Base is to avoid making the bare minimum number of decisions so you can take it wherever you need to. When it comes to features like this, it's best to merge them with a fork of Base.

That said, I'd like to start showcasing forks of Base that include interesting features. Could you send me an email (or share your address here so I can contact you) so we can chat about this? Really appreciate you putting all of this time into PR's/feature ideas!

themeteorchef avatar Jan 02 '17 12:01 themeteorchef

I just sent you an email.

rgstephens avatar Jan 02 '17 16:01 rgstephens

+1 for Griddle example.

thearabbit avatar Jan 31 '17 02:01 thearabbit

@thearabbit I posted a fork of the main project with a Griddle based List View with pagination, sorting, filtering and action buttons here. @rglover may be posting this and a couple of other example extensions to base soon.

listview

rgstephens avatar Jan 31 '17 16:01 rgstephens

Why you don't PR?

thearabbit avatar Feb 01 '17 00:02 thearabbit

I did that in #219. Please note the comment above by @themeteorchef regarding why that PR was rejected.

rgstephens avatar Feb 01 '17 06:02 rgstephens

@rgstephens @thearabbit on my list to get this on the site, just a bit backed up at the moment :)

themeteorchef avatar Feb 01 '17 17:02 themeteorchef

1- If I have more then 1,000,000 docs in Documents Collection. Have problem or not, when we pub all of document to Griddle?

Meteor.publish('documents.list', () => Documents.find());
-----
<Griddle
            results={documents}
            ......
------
const composer = (params, onData) => {
  const subscription = Meteor.subscribe('documents.list');
  if (subscription.ready()) {
    const documents = Documents.find().fetch();
    onData(null, { documents });
  }
};

export default composeWithTracker(composer, Loading)(DocumentsList);

2- Could you example to use query/selector to get some data from Documents like Tabular

{{> tabular table=TabularTables.Books selector=selector......

Template.myTemplate.helpers({
  selector() {
    return {author: "Agatha Christie"}; // this could be pulled from a Session var or something that is reactive
  }
});

thearabbit avatar Feb 03 '17 05:02 thearabbit

@thearabbit yes, this will likely cause an issue. You'll want to add some sort of pagination feature to break up the documents into easier to handle chunks.

themeteorchef avatar Feb 03 '17 18:02 themeteorchef

I don't understand about this. Could example for me? Thanks again.

thearabbit avatar Feb 04 '17 00:02 thearabbit

@thearabbit yes its problem with performance at loading! @rgstephens Maybe implement pagination, sorting with (pub/sub)?

zhanbst avatar Apr 07 '17 07:04 zhanbst