Hi Guys,
I noticed an issue after I used Data connector to generate xml for the grid in Firefox.
This does not affect IE or chrome. The grid does not seem to display any values in Firefox.
The below is the Data Connector Server Side Code
class DataValueModel{
protected $dataFields = " ";
protected $selTagId = 0;
public function __construct($dataF,$tagId)
{
$this->dataFields = $dataF;
$this->selTagId = $tagId;
}
function get($request){
global $db;
$data = array();
$result = $db->query(sprintf('
SELECT id,field_id,name
FROM data_values
WHERE field_id IN (%s)
AND active = 1
ORDER BY `index`, name
',$this->dataFields));
while ($row = $result->fetch_assoc()) { //filter user selected tags
$data[] = array("id"=> $row['id'], "name" =>$row['name']);
};
return $data;
}
function update($action){
$action->success();
}
function insert($action){
//call $action->success(); or $action->invalid();
$action->success();
}
function delete($action){
$action->success();
}
}
The client side code is :
var dp = new dataProcessor("/app/ajax_datavalues/<?=$account->id?>");
dp.action_param = "dhx_editor_status";
dvgrid = dvLayout.cells("a").attachGrid();
//dvgrid = new dhtmlXGridObject('gridbox');
dvgrid.setImagePath("/app/js/dhtmlx412/codebase/imgs/");
dvgrid.setHeader("Id, Data Value");
dvgrid.setInitWidths("100,*");
dvgrid.setColAlign("center,left");
dvgrid.setColTypes("ro,ed");
dvgrid.setColSorting("int,str");
dvgrid.enableMultiselect(true); //for deleting multiple rows
dvgrid.enableAutoHeight(true,550);
dvgrid.setUserData("", "fieldId", $("#datafield").val());
dvgrid.init();
dvgrid.attachEvent("onXLS", function(grid_obj){ //shows laoding data message
$("#loadblock").show();
});
dvgrid.attachEvent("onXLE", function(grid_obj,count){
$("#loadblock").hide();
});
dvgrid.load("/app/ajax_datavalues/<?=$account->id?>/<?=$selTagId ?>",function(){ $("#loadblock").hide(); });
dp.attachEvent("onAfterUpdate", function(sid, action, tid, xml){
if (action == "invalid"){
dvgrid.setCellTextStyle(sid, 1, "background:#eeaaaa");
dhtmlx.alert(xml.getAttribute("details"));
} else dvgrid.clearAndLoad("/app/ajax_datavalues/<?=$account->id?>/" + $("#datafield").val());
})
dp.init(dvgrid);
And the connector code used is the following
$data = array();
foreach ($account->dataFields as $datakey => $dfv){
if($selTagId != -1 && $datakey != $selTagId) continue;
$data[] = $datakey; //contains only selected data key
};
$mysqli = new Db;
$conn = new GridConnector($mysqli, "MySQLi");
$conn->configure("dummy", "id", "id, name");
$conn->useModel(new DataValueModel(join(",",$data),$selTagId));
$conn->render();
I am using the dhtmlx connector from github that you had recently posted and when I was not using connector (directly generating xml it seemed to work in firefox). But the code works perfectly in Chrome and IE 11. The FF version says 35.0.1
Any help would be greatly appreciated. Thank you for the great framework.