Categories | Question details Back To List | ||
SplitAt & onBeforeSorting Issues We are using the Pro v16 and I'm trying to use the splitAt as well was onBeforeSorting. I'm using IE 7. I have 2 issues. The first issue is I cannot sort when I have the splitAt enabled. One of my columns is a checkbox. If I try and sort the columns that are split I get "Microsoft JScript runtime error: 'this.hdr.rows.0.childNodes' is null or not an object". I tried adding the code to the dthmlxgrid.js file that is said on this post http://www.dhtmlx.com/docs/products/kb/index.shtml?cat=search&page=1&q=9827&ssr=yes&s=splitat; however I get the same error. My second issue is onBeforeSorting, when I check certain rows and click "Select" to sort by checkbox. It does not sort. I know I must be missing something here. I am recreating my data so I can retrieve the first thousand rows of the ordered data then displaying it back to the grid. snippet of code below: <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxcommon.js" type="text/javascript"></script> <link href="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid.css" rel="stylesheet" type="text/css" /> <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid.js" type="text/javascript"></script> <link href="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid_skins.css" rel="stylesheet" type="text/css" /> <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgridcell.js" type="text/javascript"></script> <link href="dhtmlx/dhtmlxTree/codebase/dhtmlxtree.css" rel="stylesheet" type="text/css" /> <script src="dhtmlx/dhtmlxTree/codebase/dhtmlxtree.js" type="text/javascript"></script> <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid_srnd.js" type="text/javascript"></script> <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid_excell_link.js" type="text/javascript"></script> <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid_excell_tree.js" type="text/javascript"></script> <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid_splt.js" type="text/javascript"></script> <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid_mcol.js" type="text/javascript"></script> <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid_math.js" type="text/javascript"></script> <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid_ssc.js" type="text/javascript"></script> <link href="dhtmlx/dhtmlxCombo/codebase/dhtmlxcombo.css" rel="stylesheet" type="text/css" /> <script src="dhtmlx/dhtmlxGrid/codebase/dhtmlxgrid_filter.js" type="text/javascript"></script> <script src="dhtmlx/dhtmlxCombo/codebase/dhtmlxcombo.js" type="text/javascript"></script> function LoadGrid(){ tree = new dhtmlXTreeObject(treebox, "100%", "100%", 0); tree.setImagePath("dhtmlx/dhtmlxTree/codebase/imgs/"); tree.loadXMLString(treeString, function() { mygrid = new dhtmlXGridObject('masterlist'); mygrid.setImagePath("dhtmlx/dhtmlxGrid/codebase/imgs/"); mygrid.setSkin("modern"); mygrid.enableSmartRendering(true, 50); mygrid.enableEditEvents(true, true, true); mygrid.attachHeader("#master_checkbox,#text_filter,#text_filter,,,,#text_filter,#text_filter,,,,,,,,,,,,"); mygrid.attachEvent("onMouseOver", doOnRowSelect); mygrid.attachEvent("onEditCell", doCellChanged); mygrid.attachEvent("onRightClick", distributeSelected); mygrid.attachEvent("onBeforeSorting", sortGridOnServer); mygrid.setDateFormat("m-d-y"); mygrid.enableColumnMove(true); mygrid.enableAutoSizeSaving(); mygrid.enableOrderSaving(); mygrid.attachEvent("onAfterCMove", function(a, b) { colId = mygrid.getColIndexById("Security_Cd"); mygrid.setSubTree(tree, colId, 0); return true; }); mygrid.setSubTree(tree, 6, 0); mygrid.init(); mygrid.splitAt(4); }); //} mygrid.loadXMLString(xmlString); mygrid.loadSizeFromCookie(); mygrid.loadOrderFromCookie(); window.status = ""; } function sortGridOnServer(ind, gridObj, direct) { //if (ind != 0) { if (direct == "asc") { orderBy = mygrid.getColumnId(ind); orderDirection = "ASC"; } else { orderBy = mygrid.getColumnId(ind); orderDirection = "DESC"; } mygrid.clearAll(); NewLoadAssetList(false, 1) //} mygrid.setColSorting("server,server,server,server,server,server,server,server,server,server,server,server,server,server,server,server,server,server,server,server"); mygrid.setSortImgState(true, ind, direct); } Answer posted by dhxSupport on Oct 01, 2009 07:33 >>The first issue is I cannot sort when I have the splitAt enabled. One of my columns is a checkbox. If I try and sort the columns that are split I get "Microsoft JScript runtime error: 'this.hdr.rows.0.childNodes' is null or not an object" This issue was fixed at the latest version of dhtmlxGrid. Please contact sales@dhtmlx.com to update your files. >>My second issue is onBeforeSorting, when I check certain rows and click "Select" to sort by checkbox. It does not sort. I know I must be missing something here. I am recreating my data so I can retrieve the first thousand rows of the ordered data then displaying it back to the grid. You can try to use dhtmlxConnectors extension. This extension can help you simplify server side operations related to dhtmlx library components (dhtmlxGrid/TreeGrid, dhtmlxTree, dhtmlxCombo, dhtmlxScheduler). Please find more information here http://dhtmlx.com/docs/products/dhtmlxConnector/index.shtml http://dhtmlx.com/dhxdocs/doku.php?id=dhtmlxconnector:toc |