How much different dhtmlx suits version 2.5 from version 2.1

I still used version 2.1 which was downloaded in Jun, 2009. Today I try the current version 2.5. I found the Javascript, and CSS, as well as sample codes are much different with version 2.1.

I already implemented applications based on version 2.1. If I switched to version 2.5, could someone suggest me where I have to beware for the changes made at version 2.5?

Thanks.

The way how samples look was changed, but API and functionality which was supported in version 2.1 are fully supported in version 2.5 ( there is no any backward incompatible changes )

The only component , which may require some attention - dhtmlxTabbar - which was updated to work in same way as other layout components. ( it still supports all previous API calls and events )

How does version 2.5 support dhtmlxConnector component? There is only one file, which is readme.txt, under the sub-direcotry dhtmlxConnector. Where are other php files?

Boa

Connectors available as separate package

dhtmlx.com/docs/products/dhtmlxC … ndex.shtml
dhtmlx.com/docs/download/dhtmlxConnector_php.zip

There few different versions , for different languages, so they not included in the package, but can be downloaded from dhtmlx.com

Thank you, Stanislav. I got it.

Boa

The following components seems different

  1. layout buttonSelect
  2. grid filter

All code work before at version 2.1, but does not work at version 2.5. What extra js should I added?

When I keep using dhtmlx 2.1 the dhtmlConnector at both client and server, the girdFilter behaves normal as usual. But it does not make sense, other components upgrade to 2.5, and keep connector at 2.1. The problem is still there.

At server side, does event beforeFilterOptions exist at version 2.5? I used the following code at version 2.1
$gridConn->event->attach(“beforeFilterOptions”,createFilterOptions);
The purpose of createFilterOptions is to add customized drop list value into #connector_select_filter

function createFilterOptions($column)
{
	$column = trim($column);
	
	switch($column) {
		case "catname":	// work
			$option = array("one","two","three");		
			$case = "catname";
			break;
		case "enabled":	// work now
			$option = array("yes","no");		
			$case = "enabled";
			break;
		default:
			$case = "default";
			break;
	}
	
	if ($column == "catname" || $column == "enabled") {
		return $option;
	}
}

If not, how can I add customized drop list value into #select_filter? I also try #connector_select_filter does not work either.

At server side, does event beforeFilterOptions exist at version 2.5?

No, it doesn’t.

The 2.5 provides beforeFilter event. Please see the documentation about it:

docs.dhtmlx.com/doku.php?id=dhtm … forefilter

I used beforeFilter event at ver 2.1, now the handlerfun parameter at version 2.5 is different than version 2.1. And my previous code does not work at ver 2.5. Could you provide solution according to my code below?

I would like to add customized drop list into into #connector_select_filter column, for example “yes” and “no”, here is test code. The drop list appears as “yes”, “no”, but the filter does not really work.

The client side code:

[code] mygrid.setHeader(“Catetory,Product,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan”);
mygrid.attachHeader(["#rspan",“Name”,“Code”,“Brief Desp”,“Price”,“in Stock”,“Sold”,“Enabled”,“Description”]);
mygrid.attachHeader("#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_select_filter,#connector_text_filter")

mygrid.setInitWidths("50,150,150,150,80,80,80,80,200");
mygrid.setColAlign("right,left,left,left,right,center,center,center,left");
mygrid.setColTypes("ed,ed,ed,edtxt,price,ed,co,ch,txt");		// ro is read only
mygrid.getCombo(5).put(1,"yes");
mygrid.getCombo(5).put(0,"no");
mygrid.setColSorting("int,str,str,str,int,str,str,str,str");
mygrid.setColumnColor("white,#d5f1ff,white,#d5f1ff,white,#d5f1ff,white,#d5f1ff");
mygrid.setColumnMinWidth(50,0);


mygrid.enableSmartRendering(true)
mygrid.enableMultiselect(true)
mygrid.init();
mygrid.loadXML("jb_01_basic_connector.php");

var dp = new dataProcessor("jb_01_basic_connector.php");
dp.init(mygrid);

[/code]

The sever side jb_01_basic_connector.php code:

	$grid->set_options("enabled",array("yes"=>"yes","no"=>"no"));
 	$grid->event->attach("beforeFilter",doBeforeFilter);
	$grid->render_table("ss_products","productID","categoryID,name,product_code,brief_description,Price,in_stock,items_sold,enabled,description");

function doBeforeFilter($column,$mask)
{
	// It is really important to trim($column) first, otherwise case will have problem
	$column = trim($column);
		
	switch($column) {
		case "enabled":	
			$where = "p.enabled=".($mask == "yes" ? 1 : 0);
			$case = "enabled";
			break;
		default:
			$where = $column." LIKE '%".$mask."%'";
			$case = "default";
			break;
	}
}

Now I also found Connector 1.0 version does not allow to use reserved keyword for mysql field name, for example. lock, which would cause “Message: Incorrect dataset minimization, master field not found.”

I appreciate that someone could provide solution. Thanks.

Boa

By any chance are you using this column name, for column in grid which use select-box editor or select filter?

In such case you can use set_options method to define custom OptionsConnector with specific options fetching rules.