bryanmylee / svelte-headless-table

Unopinionated and extensible data tables for Svelte
https://svelte-headless-table.bryanmylee.com/
475 stars 30 forks source link

How to implement expanding rows? #28

Closed Gildedter closed 2 years ago

Gildedter commented 2 years ago

Title

bryanmylee commented 2 years ago

You can refer to this for documentation examples, or the kitchen sink for a comprehensive example.

Gildedter commented 2 years ago

I have a problem with multiple plugin, because, pagination uses pageRows sort uses rows, I'm also adding expanding rows with it afterwards, but I can't seem to make addSortBy and addPagination work in conjunction

Edit: went to the kitchen sink

Gildedter commented 2 years ago

Ok so, no matter what I try, sortBy just won't work, I copied the simple example, but when I use the same example on my local machine, sorting just won't work, any ideas? I'm not getting any errors whatsoever, that's why I can't diagnose the issue

package.json:

"devDependencies": {
    "@babel/core": "^7.14.0",
    "@babel/preset-env": "^7.14.0",
    "@hurtigruten/svelte-table": "^2.0.3",
    "@iconify/svelte": "^2.2.1",
    "@sveltejs/adapter-static": "^1.0.0-next.26",
    "@sveltejs/kit": "next",
    "@testing-library/jest-dom": "^5.14.0",
    "@testing-library/svelte": "^3.0.0",
    "@types/jest": "^27.0.0",
    "@types/testing-library__jest-dom": "^5.14.0",
    "autoprefixer": "10.4.5",
    "babel-jest": "^27.0.0",
    "cross-env": "^7.0.3",
    "date-picker-svelte": "^2.0.0",
    "flowbite": "^1.4.5",
    "flowbite-svelte": "^0.17.3",
    "jest": "^27.0.0",
    "jspdf": "^2.5.1",
    "n2words": "^1.11.1",
    "postcss": "^8.4.12",
    "postcss-load-config": "^3.1.4",
    "svelte": "^3.44.0",
    "svelte-check": "^2.2.6",
    "svelte-headless-table": "^0.10.2",
    "svelte-jester": "^2.0.1",
    "svelte-preprocess": "^4.9.4",
    "svelte-typeahead": "^4.2.2",
    "tailwindcss": "^3.0.23",
    "ts-jest": "^27.0.0",
    "tslib": "^2.3.1",
    "typescript": "^4.6.2",
    "wretch": "^1.7.9",
    "xlsx": "https://cdn.sheetjs.com/xlsx-0.18.9/xlsx-0.18.9.tgz"
  },

svelte.config.js

/** @type {import('@sveltejs/kit').Config} */
const config = {
    // Consult https://github.com/sveltejs/svelte-preprocess
    // for more information about preprocessors
    preprocess: preprocess({ postcss: true }),

    kit: {
        adapter: adapter(),

        // Apply the proxy setup
        vite: () => ({
            server,
            optimizeDeps: {
                include: ['fuzzy'],
            },
        }),
    },
};

export default config;