Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

Vue JS KTDATATABLE



<Datatable
:loading="loading"
:header="tableHeader"
:data="tableData"
:total="countData"
:current-page="params.offset + 1"
@page-change="changePage"
@on-items-per-page-change="changeRowsPerPageLimit"
@on-sort="handleSort"
>



const fetchData = async () => {
loading.value = true;
const { data, params: updatedParams } = await DataTablesService.fetchDatax(urlPagination, params.value);
tableData.value = data.records;
countData.value = data.totalCount;
params.value = updatedParams; // Update params in the component
DataTablesService.saveParamsToStorage(updatedParams);
loading.value = false;
};


Set current page not working when data already fetched using server side.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


FIXED WITH THIS on table footer component but i dont know it will be bugs on my project next. LOL happy

watch(
() => props.count,
() => {
if(page.value == 0){ ///ADED VALUE ON THIS
page.value = 1
}
// page.value = 1;
}
);


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(