PHP connector with dynamic loading and in-header filter

Hello,

I’m using version 4.1.2 and the db_sqlsvr wrapper for fetching data from a DB and am trying to use the in-header filter together with $grid->dynamic_loading(); Is this fully supported now? I can see in the server log that the distinct values are correctly queried but they don’t show up in the select filter drop-downs until I use a text filter. Then the values appear and filtering works but the count is not correctly updated. Without dynamic loading all is OK.

Any way how to get the in-header filter working with dynamic loading?

Thanks,

Steffen

Please share the server side log and php code with connector’s initialization.

This is the server log: pastebin.com/1WiY5u0i

PHP code server side:

require("../codebase4/db_sqlsrv.php");
	require("../codebase4/grid_connector.php");
	
	//default sorting
	function custom_sort($sorted_by){
          //SORT BY some_field ASC
          if (!sizeof($sorted_by->rules)) {
               $sorted_by->add("Year","DESC");
			   $sorted_by->add("Country","ASC");
			   $sorted_by->add("Location","ASC");
			   $sorted_by->add("PrimaryRefNo","ASC");
			}
	}
	
	$grid = new GridConnector($conn,"SQLSrv");	
	$grid->event->attach("beforeSort","custom_sort");
	$grid->enable_log("temp.log",true);
	$grid->dynamic_loading(100);
	$grid->render_sql("SELECT  l.* FROM dbo.icd10_list_mimw l left join dbo.icd10_IndCode_MIMW c on l.MemberNo=c.Ind_IOMIndID left join dbo.icd10_invalid_MIMW i on l.MemberNo=i.iomid WHERE c.Ind_IOMIndID is null and i.iomid is null", "MemberNo", "Year,Country,Location,Nationality,PrimaryRefNo,Status,Age,Gender,TB,LTBI,HIV,Mental,Addiction,Pregnancy");

PHP code client side:

icdlist = tabbar_list.cells("a1").attachGrid();
	icdlist.setHeader("Year,Country,Location,Nationality,Case,Status,Age,Sex,TB,LTBI,HIV,Mental,Addiction,Pregnancy");
	icdlist.attachHeader("#connector_select_filter,#connector_select_filter,#connector_text_filter,#connector_select_filter,#connector_text_filter,#connector_select_filter,#connector_text_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter,#connector_select_filter");
	icdlist.attachFooter("<strong>Records:</strong>,{#stat_count},,,,,,,,,,,,<a href='javascript:void(0)' onclick='excelexport()'>Export</a>");
	icdlist.setInitWidths("70,70,70,90,80,60,40,50,40,40,40,60,*,*");
	icdlist.setColSorting("connector,connector,connector,connector");
	icdlist.setEditable(false);
	icdlist.attachEvent("onXLS",function(){ dhxLayout.cells("b").progressOn();});
	icdlist.attachEvent("onXLE",function(){ dhxLayout.cells("b").progressOff();});
	icdlist.attachEvent("onRowSelect", fill_details);
	icdlist.attachEvent("onAfterRowDeleted", clear_details);
	icdlist.init();
	icdlist.enableSmartRendering(true,100);
	icdgrid.enablePreRendering(50);
	icdlist.load("icdlist_sqlsvr.php")

Thanks,

S. Schillinger

Just tried the same code with codebase version 4.02 and it works fine. So, obviously a bug in 4.12.

(a) Please try to grab the latest connector files from github
github.com/dhtmlx/connector-php

Also, can you try to run the query from the log directly against the DB. Does it return correct number of rows in the table or is it wrong.

Thanks a lot for your answer. I have upgraded to version 4.1.3 today and header filters are working now.

BR,

S. Schillinger