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

KTDatatable Paging

I am using AJAX in ktdatatable and Spring MVC model.

How to get Paging information from the request in Controller?

Here my code.

I tried to use parameter map to get value from pagination info.

But there is nothing. How do I need to do?

Javascript

datatable = $('#detail_datatable').KTDatatable({ // datasource definition data: { type: 'remote', source: { read: { url: '/retrieveItemConfig', data: {}, map: function(raw) { // sample data mapping var dataSet = raw; if (typeof raw.data !== 'undefined') { dataSet = raw.data; } return dataSet; }, }, }, pageSize: 5, // display 20 records per page serverPaging: true, serverFiltering: false, serverSorting: true, saveState: false, },

// layout definition layout: { scroll: false, // enable/disable datatable scroll both horizontal and vertical when needed. footer: false, // display/hide footer },

// column sorting

pagination: true,

toolbar: { // toolbar placement can be at top or bottom or both top and bottom repeated placement: ['bottom'],

  // toolbar items
  items: {
     // pagination
     pagination: {
        // page size select
        pageSizeSelect: [5, 10, 20, 30, 50, 999], // display dropdown to select pagination size. -1 is used for "ALl" option
     },
  },

},

search: { input: $('#search_query_order'), key: 'generalSearch' },

// columns definition columns: [...]

Spring controller

@RequestMapping(value = "/retrieveItemConfig" ) public List<ItemConfig> retrieveItemConfig(@RequestParam Map<String, String> parameters){ System.out.println(parameters); return service.retrieveItemConfig(); }

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)


Hi,

Please check our example KTDatatable online.
https://preview.keenthemes.com/keen/demo1/features/ktdatatable/base/data-ajax.html

You can see the parameters that are being sent from KTDatatable to the server using the Remote tab in the Devs tool.





Thanks


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  :(