vue3 datatable page length

vue3 datatable page length

mujeeb989mujeeb989 Posts: 1Questions: 1Answers: 0

how we can enable page length with static or serverside in vue3 datatale ?

Answers

  • kthorngrenkthorngren Posts: 22,070Questions: 26Answers: 5,086

    Are you asking about displaying the length change element or setting the initial page length? The lengthChange and layout control the display of the length change element. The pageLength option is used to set the initial page length. This blog explains how to set the options. I tried the examples on that page but they don't load with this error:

    > vite
    
    failed to load config from /home/projects/datatables-net-vue3-simple/vite.config.ts
    error when starting dev server:
    Error: The service was stopped
        at eval (/home/projects/datatables-net-vue3-simple/node_modules/esbuild/lib/main.js:1337:25)
        at eval (/home/projects/datatables-net-vue3-simple/node_modules/esbuild/lib/main.js:666:9)
        at Socket.afterClose (/home/projects/datatables-net-vue3-simple/node_modules/esbuild/lib/main.js:644:7)
        at Socket.emit (node:events:30:11150)
        at endReadableNT (node:internal/streams/readable:230:10631)
        at processTicksAndRejections (node:internal/process/task_queues:196:1067)
        at <anonymous> (https://datatablesnetvue3simple-hud3.w-credentialless-staticblitz.com/blitz.10996a95.js:31:296153)
        at _0x219a37 (https://datatablesnetvue3simple-hud3.w-credentialless-staticblitz.com/blitz.10996a95.js:31:296234)
        at _0x12aa80 (https://datatablesnetvue3simple-hud3.w-credentialless-staticblitz.com/blitz.10996a95.js:31:549098)
        at Object.finish (https://datatablesnetvue3simple-hud3.w-credentialless-staticblitz.com/blitz.10996a95.js:31:545788)
    
    ~/projects/datatables-net-vue3-simple 1s
    ❯ 
    

    @allan will need to look at the errors.

    Please provide more details of the problem you are trying to solve. Minimally show the configuration you already have or better a test case replicating the issues you are trying to solve.

    Kevin

  • allanallan Posts: 64,628Questions: 1Answers: 10,685 Site admin

    Try this: https://stackblitz.com/edit/xumbveaj?file=index.html .

    The download builder when you select the "Vue component" option will show a "Stackblitz" option at the bottom of the page, which when clicked will create a new template project and run it (which is how I got the link above).

    There was an error in that, which I've just fixed. It was using an old version of Vite which appeared to have a problem with current StackBlitz. I've updated the dependencies now and it works as expected now.

    Allan

Sign In or Register to comment.