Dhtmlx grid data loading

Hi,
I am using dhtmlx grid smart rendering where I have 10000 of rows of data fetched from server.
The main problem I have is, whenever I try to load data in grid, it takes time to load data from server almost 9-10 sec, later I found that grid fetches all the 10000 rows and then display the rows.
Later, I have added enableSmartRendering(true,50) in client side and dynamic_loading(50) in server side. It still have the same problem. No problem with data loading on scroll but initially it takes time to load the data.
Is there any way to control that? Or there’s something that I am doing wrong? Initially I just want to pull 50rows and pull more on scroll.
I would be very much thankful for any assist.
Thanks

By the way I am using mysqli, with php
Here is my client side and server side code
myGrid = new dhtmlXGridObject(‘gridbox’);
myGrid.setImagePath("<?php echo $path; ?>");
myGrid.setHeader(“header1,header2,header3,header4,header5, header6, header7, header8, header9”);
myGrid.attachHeader(" ,#connector_select_filter,&nbsp ,&nbsp ,&nbsp,#connector_select_filter, ,#connector_text_filter,");
myGrid.setInitWidths(“100,100,100,200,200,200,100,200,200,200”);
myGrid.setColAlign(“left,left,left,left,left,left,left,left,left,left”);
myGrid.setColTypes(“ro,ro,ro,ro,ro,ro,ro,ro,ro,ro”);
myGrid.setColSorting(“na,na,na,na,na,na,na,na,na,na”);
myGrid.init();
myGrid.enablePreRendering(true,50);
myGrid.load(“get_all_the_data”);

Below is my server side scripting

require(“dhtmlx/connector/codebase/grid_connector.php”); // connector file
require(“dhtmlx/connector/codebase/db_mysqli.php”); // connector file
$mysqli = new mysqli($hostname, $username, $password, $db);
$gridConn = new GridConnector($mysqli, “MySQLi”);
$gridConn->enable_log(“temp.log”, true);
$gridConn->dynamic_loading(50);
$sql = “SELECT table1.id,table1.field1,table1.field2,table1.field3,table1.field4,table1.field5,table1.field6, table2.field7, table3.field8,table4.field9 FROM table1, table2, table3, table4 WHERE table1.id = table2.connectingId AND table1.id = table3.connectingId AND table1.id = table4.connectingId”;

$gridConn->render_sql($sql, ‘id’, ‘field1,field2,field3,field4,field5,field6,field7,field8,field1field9’); // data configuration

Note: mygrid is on body onload.
Thanks in advance
Thanks

In your provided code you have:
myGrid.enablePreRendering(true,50);

Please, try to use the smart rendering mode:
myGrid.enableSmartRendering(true,50);

Thanks Sematik
That was an type error,
I am using
myGrid.enableSmartRendering(true,50);
Thanks for help though. Any more idea what I am doing wrong?

Code looks fine, can you please try to use the dev. tools of browser and check which response you are receiving for the first data loading attempt. Does server side generate data for 50 rows only, or for all rows in the database.

Also, please be sure that “get_all_the_data” is triggers the same php feed that contains the dynamic_loading command.

And the last, if issue still occurs, please share the content of temp.log file, that was generated by connector.