Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Response Auto load #21

Closed
Fzoltan87 opened this issue Jun 22, 2022 · 14 comments
Closed

Server Response Auto load #21

Fzoltan87 opened this issue Jun 22, 2022 · 14 comments

Comments

@Fzoltan87
Copy link

Fzoltan87 commented Jun 22, 2022

Hy,

After loading the page, my spreadsheet is empty, but when I perform an operation (scrolling, searching) I get a server response.
How can I make the server response run automatically after the page loads?
Maybe an idea? Or a sample code?

My source code and structure:

datalist.php =>Data from the database

"deferLoading" Is this parameter required?

index.php

<table id="recordlist" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Status</th>
<th style="width:10%;">Modify</th>
<th style="width:10%;">Delete</th>
</tr>
</thead>
<tbody></tbody>
</table>


let table = new JSTable("#recordlist", {
	serverSide : true,
	addQueryParams: false,
	deferLoading: 5,
	ajax : "datalist.php"
});
@Trekky12
Copy link
Collaborator

Hey @Fzoltan87,

the server side rendering is performed for all requests other than the initial loading. You need to render your "first page" in the index.php file.

@Fzoltan87
Copy link
Author

Fzoltan87 commented Jun 22, 2022

So do you really need the first server-side query between the <tbody></tbody> html tags?

@Trekky12
Copy link
Collaborator

Yes, this is correct, the first rendering needs to be done when creating the table.

@Fzoltan87
Copy link
Author

Very good. Thank you very much. Are you planning any new features or fixes in the script in the future?

@Trekky12
Copy link
Collaborator

Actually there is currently nothing specific planned. Do you have a feature request?

@Fzoltan87
Copy link
Author

Fzoltan87 commented Jun 22, 2022

I would be interested for the server to respond automatically after the page loads (html and javascript code should be php free). I'd love to donate for it.

@Trekky12
Copy link
Collaborator

I will look into it ;-)

@Fzoltan87
Copy link
Author

Great. Thank you ;)

@Fzoltan87
Copy link
Author

Hy Trekky12! Did you manage to look it up?

Trekky12 added a commit that referenced this issue Jun 25, 2022
this should fix issue #21 and be consistend with datatables deferLoading
(https://datatables.net/reference/option/deferLoading)
When deferLoading is not set the table is loaded from the server,
otherwise the value should be the number of total rows of the table
@Trekky12
Copy link
Collaborator

Could you please test the version in the development branch? When the option deferLoading is not set the table should be loaded from the server.

@Fzoltan87
Copy link
Author

Fzoltan87 commented Jun 25, 2022

Success. The server data is downloaded without entering the php code (In Javascript code without specifying a deferLoading value).
I think you can release the new version. How much does this update cost?

Trekky12 added a commit that referenced this issue Jun 25, 2022
- Add possibility to request first page of server side rendering page
(#21)
- Update dependencies
@Trekky12
Copy link
Collaborator

Trekky12 commented Jul 1, 2022

Great! I've published the changes in the new version.
This update is free ;-) You can of course buy me a coffee if you like at https://www.buymeacoffee.com/YXln3gCkm

@Fzoltan87
Copy link
Author

Great! I've published the changes in the new version. This update is free ;-) You can of course buy me a coffee if you like at https://www.buymeacoffee.com/YXln3gCkm

Thank you very much for your help. I invited you to coffee. :)

@Trekky12
Copy link
Collaborator

Trekky12 commented Jul 4, 2022

Great! Thank you! ☺️

@Trekky12 Trekky12 closed this as completed Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants