Griddle icon indicating copy to clipboard operation
Griddle copied to clipboard

Is it supposed to look like this?

Open jamesskyoung opened this issue 9 years ago • 11 comments

Griddle version

"griddle-react": "^1.0.0", (Also tried current version)

Expected Behavior

LIke the site --> https://griddlegriddle.github.io/Griddle/docs/

Actual Behavior

See screenshot

Steps to reproduce

Use code from https://griddlegriddle.github.io/Griddle/docs/

Also cloned the current repo... all examples look like there's a missing css etc...

screen shot 2017-05-06 at 10 04 08

Pull request with failing test or storybook story with issue

While this step is not necessary, a failing test(s) and/or a storybook story will help us resolve the issue much more easily. Please see the README for more information.

jamesskyoung avatar May 06 '17 09:05 jamesskyoung

Edit: Tried

npm install griddle-react@version0 --save 

That works.. (after changing data= to results of course.

So something's either missing in the dependencies.. or..?

fyi example is this simple.. v1 does not work with this... see screenshot above. v0.x does. (after simple change)

var data = [
    {
    "id": 0,
    "name": "Mayer Leonard",
    "city": "Kapowsin",
    "state": "Hawaii",
    "country": "United Kingdom",
    "company": "Ovolo",
    "favoriteNumber": 7
    }
  
];
    return (
          <Griddle
            results={data}
          />
    )
  }

jamesskyoung avatar May 06 '17 11:05 jamesskyoung

v0 result. screen shot 2017-05-06 at 12 37 52

jamesskyoung avatar May 06 '17 11:05 jamesskyoung

Hi , we are also facing the same issue for the beta version - "griddle-react": "^1.0.0".

ghost avatar May 08 '17 07:05 ghost

@jamesskyoung
Any idea why it didn't work in the latest version.

ghost avatar May 08 '17 12:05 ghost

None sorry....

jamesskyoung avatar May 08 '17 13:05 jamesskyoung

I've been using pre V1... but wanted to try the latest version...

jamesskyoung avatar May 08 '17 13:05 jamesskyoung

In version 1+, all the default styling is removed. You have to add your own. I use bootstrap styles, so this works for me.

const styleConfig = {
  icons: {
    TableHeadingCell: {
      sortDescendingIcon: '▼',
      sortAscendingIcon: '▲',
    },
  },
  classNames: {
    Row: 'row-class',
    Table: 'table-striped, table',
  },
  styles: {
    Filter: { fontSize: 18 },
  },
};
....
 <Griddle
     data={rows}
    plugins={[plugins.LocalPlugin]}
   styleConfig={styleConfig}
.....

sww314 avatar May 08 '17 18:05 sww314

Thanks @sww314 -- This is the intent with Griddle 1.0 is that we are not forcing / shipping styles to other folks in the community (especially if they are going to not be used). It's really tough to determine the right level of out-of-the-box features to ship as part of a project and ultimately we landed on styling should be handled outside of Griddle.

If someone wants to make a default style and submit it as a PR to the griddle-docs project that people can download / copy and include if they want, I'd be happy to pull that in to the docs project but would prefer to avoid adding it here. 👍

ryanlanciaux avatar May 08 '17 18:05 ryanlanciaux

ok thanks folks... appreciate the responses...

jamesskyoung avatar May 08 '17 19:05 jamesskyoung

@sww314 . Forgot to add tx!

I would add though that some level of rudimentary styling is desirable out of the box.. otherwise... you'll end up with what I showed above. Granted... I didn't use styleConfig like I should have. If I hadn't used Griddle before, I would have quickly moved on.

jamesskyoung avatar May 09 '17 16:05 jamesskyoung

As of #677, it would now be feasible to include a basic default style plugin, and to fix up the LegacyStylePlugin to look/act like Griddle v0 by default. If anyone cares to contribute, we could use your help!

dahlbyk avatar Jun 19 '17 04:06 dahlbyk