Coded
Templates by
Metronic Creators
2023 Templates Bundle
Metronic Mega Theme
Seven HTML Pro
All Templates
Pro Templates
Free Templates
Metronic ASP.NET
Vectors
Devs
Learn
We are proud to
work with Experts
Preview
Downloads
Documentations
Get Support
Buy Metronic
How-to & Tricks
Metronic Tutorials
Keen Tutorials
Blog & Announcements
Product FAQs
Support Policy
License Terms
Privacy Policy
Terms & Conditions
Refund Policy
Contact Us
Custom Work
Affiliate Program
Request Icons
Hire
Light
Dark
System
Sign In
Ask
Question
All Questions
3,276
Popular
Tags
Categories
Suggestions
95
Pre-sale Questions
144
Metronic
2,716
Getbootstrap
59
KeenThemes Market
68
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
retrieveItemConfig(@RequestParam Map
parameters){
System.out.println(parameters);
return service.retrieveItemConfig();
}
jungwoo lee
1 year ago
Datatables
1 Answers
Text formatting options
Private reply
Cancel
Submit
Here's a how to add some HTML formatting to your comment:
<pre></pre>
for JS codes block
<pre lang="html"></pre>
for HTML code block
<pre lang="scss"></pre>
for SCSS code block
<pre lang="php"></pre>
for PHP code block
<code></code>
for single line of code
<strong></strong>
to make things bold
<em></em>
to emphasize
<ul><li></li></ul>
to make list
<ol><li></li></ol>
to make ordered list
<h3></h3>
to make headings
<a></a>
for links
<img>
to paste in an image
<blockquote></blockquote>
to quote somebody
:)
:|
:(
Replies (1)
F
Faizal
Author
1 year ago
Reply
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.
https://ibb.co/qr0Prmn
https://ibb.co/dbt5BBj
Thanks
Text formatting options
Private reply
Cancel
Submit
Here's a how to add some HTML formatting to your comment:
<pre></pre>
for JS codes block
<pre lang="html"></pre>
for HTML code block
<pre lang="scss"></pre>
for SCSS code block
<pre lang="php"></pre>
for PHP code block
<code></code>
for single line of code
<strong></strong>
to make things bold
<em></em>
to emphasize
<ul><li></li></ul>
to make list
<ol><li></li></ol>
to make ordered list
<h3></h3>
to make headings
<a></a>
for links
<img>
to paste in an image
<blockquote></blockquote>
to quote somebody
:)
:|
:(
Text formatting options
Private reply
Cancel
Submit
Here's a how to add some HTML formatting to your comment:
<pre></pre>
for JS codes block
<pre lang="html"></pre>
for HTML code block
<pre lang="scss"></pre>
for SCSS code block
<pre lang="php"></pre>
for PHP code block
<code></code>
for single line of code
<strong></strong>
to make things bold
<em></em>
to emphasize
<ul><li></li></ul>
to make list
<ol><li></li></ol>
to make ordered list
<h3></h3>
to make headings
<a></a>
for links
<img>
to paste in an image
<blockquote></blockquote>
to quote somebody
:)
:|
:(
Search
ctrl + /
Metronic
Go to Metronic
Downloads
Purchase Metronic
Refunds
React Dev Vacancy
KeenThemes is looking for a
Junior React or Vue
developer to build awesome apps.
Apply
Please wait...
No recent searches
Sign In
Email
Password
Forgot Password ?
Remember me
Sign In
Please wait...
Sign In with Google
Or
Create an Account
Thank you!
We have sent an activation link to your email.
Please click it and you are done.
Your email is confirmed. Please sign in to use our services.
Sign In
Create Account
Email
Password
Confirm Password
I agree with
Keenthemes Term of Use
Sign Up
Please wait...
Sign In with Google
Already have an account ?
Sign In
Forgot Your Password ?
Please enter your email and we will send a link to your email to reset your password
Reset Password
Please wait...
Cancel
We use cookies to ensure you get the best experience on our website.
Learn more
I agree