Row Selection in Split Mode

Hi there,

I am having some issues with the DHTMLX Grid in Split mode.

We have a requirement that specifies that rows should be selectable via a checkbox, and all rows can be selected/deselected with a master checkbox.

For the master checkbox event, dhtmlxgrid_filter.js --> dhtmlXGridObject.prototype._in_header_master_checkbox was updated to include the following:

[code]a.getElementsByTagName(“input”)[0].onclick=function(a){

if (typeof masterCheckEvent=='function'){
	masterCheckEvent(d,this.checked);
}[/code]

In the page:

[code] function masterCheckEvent(gridRef,state) {
if (state) {
gridRef.selectAll();

	} else {
		gridRef.clearSelection();

	}
}[/code]

This works fine for grids which are not in split mode.

When split mode is enabled the selectAll() function only selects rows on the left hand side of the split.

Presumabely in split mode two grids are used (the second with reference cgrid2_ + UID).

I have the following questions:

  1. Should selectAll() select all rows for both grids. If yes, is there any reason why it would not be happening for me?

  2. Can you provide a reference to the secondary grid object so that selectAll can be called for that grid also as a potential workaround?

A final, not completely related question:

  1. Is there a straight forward way to prevent selected rows from bolding when a data processor is attached to the grid?

Appreciate the help.

Thanks,
David

Any help for this one?

Thanks,
David

Just to add, we are currently using DHTMLX Suite 3.6 Professional.

Please confirm if you need more details to answer the above questions?

Thanks,
David

Unfortunately the issue cannot be reproduced locally.
selectAll() method works well for us in the splitted mode.

If issue still occurs - please, provide with any kind of sample of your code with the init of your grid.

Hi,

I split out most content from our JSP to leave only the grid initialization, but the error is still persisting at this point.

Please find the grid initialization code below.

[code]
<%@ taglib uri=“http://struts.apache.org/tags-html” prefix=“html”%>
<%@ taglib uri=“http://struts.apache.org/tags-bean” prefix=“bean”%>
<%@ taglib uri=“http://struts.apache.org/tags-logic” prefix=“logic”%>
<%@ taglib prefix=“c” uri=“http://java.sun.com/jsp/jstl/core”%>

html:html

[/code]

Sample test data:

<?xml version='1.0' encoding='iso-8859-1'?> <rows> <row id="1"> <cell>false</cell> <cell>123456</cell> <cell>12/08/2011</cell> <cell>01/01/2001</cell> <cell>01/01/2999</cell> <cell>12/31/9999</cell> <cell>12/12/2014</cell> <cell>Corner</cell> <cell>Some text</cell> <cell>A Place</cell> <cell>Some text</cell> <cell>Some text</cell> <cell>Area1</cell> <cell>Region6</cell> <cell>District A</cell> <cell>User</cell> <cell>09/09/2013</cell> </row> </rows>

Please let me know if you observe anything that may cause this behavior.

Thanks,
David

Any update for this? Is the grid initialization okay?

Hi Dhtmlx team,

If you cannot replicate the above issue can you please provide me with a simple way to reference the 2nd grid when in split mode. That may give me something to work with if I can’t get this working.

Thanks,
David

Please, try to change some more code in your dhtmlgrid_filter.js

a.getElementsByTagName(“input”)[0].onclick=function(a){

var d=this; //replace this line
if (typeof masterCheckEvent==‘function’){
masterCheckEvent(d,this.checked);
}

with the following:
var self=this._realfake ? this._fake : this;

After that to solve the issue with clearing the selection please, open ticket at support.dhtmlx.com so we can provide you with the fixed dhtmlxgrid_splt.js

Thanks sematik, your suggestion worked for selecting all rows.

I’ll work on requesting the updated/fixed dhtmlxgrid_splt.js. Can you confirm that clearAll does not work correctly in split mode and is corrected in the updated dhtmlxgrid_splt.js? I will need to provide an update to our team for what exactly the issue is.

Thanks again for your support.

David

The clearAll() method should work well in the splitted grid.

There was an issue with clearSelection() method in the splitted grid in your demo.
But now you don’t need to open a ticket for the fix.
Just try to add “true” attribute to the clearSelection method:
gridRef.clearSelection(true);