Hi,
I am currently using the connector and grid to load database table for my project in my company.
The table i am loading has over 5000 rows, 16 column. When i use the smart rendering feature, it can load very quick, but it could not load the whole table.
I need to load the whole table to retrieve some data which i don’t know which row are they in. But it became extremely slow, and the web site became stuck there.
Is there solution that i can load the whole database table, and also are not so slow?
Could any one help me with that? It is very urgent. I will appreciate it a lot!
Thank you very much!
P.S. May i ask another small question, does any one know how to change the filter header box width in the grid?
The problem mostly not in server side code ( which will be relative fast for 5k rows ) but in client side code, if you are not using smart-rendering mode, it will need to render all rows - which is a lot of work, and results in complex html page which slowdowns browser as well.
You can use smartRendering on client side and calculate necessary extra data on server side and just sent it to client with grid’s data or by separate ajax call.
May i ask another small question, does any one know how to change the filter header box width in the grid?
It is hardcoded in dhtmlxgrid_filte.js but you can redefine it as
.gridbox .filter input{
width:100px !important;
}
Hi Stanislav,
Thank you very much for your reply.
You can use smartRendering on client side and calculate necessary extra data on server side and just sent it to client with grid’s data or by separate ajax call.
I am not fully understand this part? Is that meaning everytime i want to get something, i reload the grid? How to reload the grid? Could you give me a simple example of that?
Have a nice weekend!
To reload grid
grid.clearAll();
grid.load(url);
As for recalculation strategy:
- if you need to reset values for all rows in grid, in case of big dataset it will be faster to use dyn. loading and just reload grid with new data from server side.
- If you need to calculate some value based on data from ALL rows of big grid, it may be faster to use dyn. loading and calculate data on server side ( you can use ajax call to separate php script which will provide data in question )
Hi Stanislav,
Thanks a lot for your solution and help. I think i understand it now.
May i ask you another question about the filter width? Can i define the width base on different columns in the grid. Some are narrow and others are wide?
Thank you very much!
It is not possible through css ( as columns doesn’t have separate css classes ), but you can set width of filter in percents
Hi Stanislav,
Is there any tutorial that include this part, i mean how to setup precentage width? Thanks a lot for your help.
Have a nice day!
Unfortunately there is no special tutorial, after grid rendering you can access html element of filter like
var node = grid.getFilterElement(index);
node.style.width = some_column_specific_value;
Hi Stanislav,
Thanks for your help. Your answer is good enough for my question.
Have a great day!