Hello all!
I have some problem: dhtmlxWindows with attach grid, toolBar and statusBar is closing very long time.This occurs only when the grid has more than 1000 rows. Otherwise all good. And more, if grid has more than 2000 rows export to EXCEL and PDF not work. What can I do with this?
Here is the JS code:
var dhxWins, win, mygrid, toolbar, statusBar;
var count = 0;
function createWindow()
{
count++;
var winId = "win" + count;
dhxWins = new dhtmlXWindows();
dhxWins.setImagePath("../dhtmlxWindows/codebase/imgs/");
dhxWins.setSkin("dhx_skyblue");
dhxWins.setEffect("move", true);
win = dhxWins.createWindow(winId, 50, 70, 400, 350); //(id, x, y, width, height)
win.setText("Встроенная таблица в окно");
//win.attachObject("gridbox");
win.keepInViewport(true);
dhxWins.window(winId).progressOn();
//mygrid = new dhtmlXGridObject("gridbox");
mygrid = win.attachGrid();
mygrid.setImagePath("../dhtmlxGrid/codebase/imgs/");
mygrid.setHeader("№, ID, NAME");
mygrid.setInitWidths("30,50,*");
mygrid.setColAlign("center,center");
mygrid.setColTypes("ro,ro,ro");
mygrid.setSkin("dhx_skyblue"); //modern
mygrid.init();
mygrid.loadXML("dbworking.php");
toolbar = win.attachToolbar();
toolbar.setIconsPath("../dhtmlxToolbar/samples/common/imgs/");
toolbar.addButton("excel", 0, "Експорт в Excel", "export_excel.png", "export_excel.png");
toolbar.addSeparator("sep1", 1);
toolbar.addButton("pdf", 2, "Експорт в PDF", "export_pdf.png", "export_pdf.png");
toolbar.attachEvent("onClick", function(id)
{
if(id == "excel")
mygrid.toExcel('../dhtmlxGrid/grid-excel-php/generate.php');
else if(id == "pdf")
mygrid.toPDF('../dhtmlxGrid/grid-pdf-php/generate.php');
});
statusBar = win.attachStatusBar();
statusBar.setText("Количество строк: рассчитываю...");
mygrid.attachEvent("onXLE", function() //Когда таблица полностью загрузилась
{
statusBar.setText("Количество строк: " + mygrid.getRowsNum());
dhxWins.window(winId).progressOff();
});
}
Thanks in advance for your help!
PS: sorry for my English - I’m from Ukraine