Check console for JS errors which you might be getting.
Helping you always. Don't forget to click "Mark as Answer" on the post that helped you.
♠ ASP.NET Core Tutorials → Start from the Beginning and become an Expert in 30 days time ♠
The first half of this line of code is used to set your datatable to page 2, please refer to page(), Please be aware that this method sets the page to be shown - it does not actually perform the
re-display of the table. In order to have the newly set page shown use the draw() method, which can be called simply as a chained method of the page() method's returned object - for example table.page( 0 ).draw( false );.
I'm not sure how to understand the it does not work, is it that it's not showing 2nd page when page load? If so, please set draw(false) instead. If not, what is the result you are expecting?
Member
16 Points
172 Posts
datatable of jquery's table111.page(1).draw(true) is not working
Jun 03, 2020 12:52 PM|rajemessage|LINK
hi,
it works in first case but not in second , pls tel me why
Participant
1253 Points
936 Posts
Re: datatable of jquery's table111.page(1).draw(true) is not working
Jun 03, 2020 03:27 PM|yogyogi|LINK
Check console for JS errors which you might be getting.
♠ ASP.NET Core Tutorials → Start from the Beginning and become an Expert in 30 days time ♠
Contributor
3140 Points
983 Posts
Re: datatable of jquery's table111.page(1).draw(true) is not working
Jun 04, 2020 02:04 AM|Yang Shen|LINK
Hi rajemessage,
I don't think it's the draw() method that caused this issue.
In the "columns" of the dataTable(), the value of "data" does no match the field name in dd.
Please refer to below JS code and see if it works for you.
In addition, seems you may have confused Data rendering and Javascript sourced data. In your case, i think the JS source data might be more suitable.
Or if i misunderstood anything, please correct me. Thanks!
Best Regard,
Yang Shen
Member
16 Points
172 Posts
Re: datatable of jquery's table111.page(1).draw(true) is not working
Jun 05, 2020 05:33 AM|rajemessage|LINK
i have checked it is not working , is it working at your end?
Contributor
3140 Points
983 Posts
Re: datatable of jquery's table111.page(1).draw(true) is not working
Jun 05, 2020 06:30 AM|Yang Shen|LINK
Hi rajemessage,
Yes, it's working at my end.
Would you please share screenshot of your current output and the latest code you are testing with?
Also, please press F12 to open the devtool and check if there's any error message in console.
Best regard,
Yang Shen
Member
16 Points
172 Posts
Re: datatable of jquery's table111.page(1).draw(true) is not working
Jun 06, 2020 08:34 AM|rajemessage|LINK
well, there is some error message in the console,
but both examples are on the same page. both are working(they bind the grid properly) but
this line
table111.page(1).draw(true)
only works in first case. not in the second case.
pls copy past my code in jsfiddle it is easy , so that u can test it is not working there also
please tel me how can upload or share image here.
Member
16 Points
172 Posts
Re: datatable of jquery's table111.page(1).draw(true) is not working
Jun 06, 2020 02:13 PM|rajemessage|LINK
this is jsfiddle link pls check https://jsfiddle.net/ryadav/c4bzv187/
Contributor
3140 Points
983 Posts
Re: datatable of jquery's table111.page(1).draw(true) is not working
Jun 08, 2020 07:50 AM|Yang Shen|LINK
Hi rajemessage,
The first half of this line of code is used to set your datatable to page 2, please refer to page(), Please be aware that this method sets the page to be shown - it does not actually perform the re-display of the table. In order to have the newly set page shown use the draw() method, which can be called simply as a chained method of the page() method's returned object - for example table.page( 0 ).draw( false );.
I'm not sure how to understand the it does not work, is it that it's not showing 2nd page when page load? If so, please set draw(false) instead. If not, what is the result you are expecting?
About how to insert image, please check How to post a image at this panel?.
Best Regard,
Yang Shen