Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by le van on Oct 07, 2009 07:42
open dhtmlx forum
Right email - Combobox in dhtmlxgrid doesn't working properly with connector

Sorry ,the first question i've sent to you have a problem. My email i filled in is wrong. Sorry again for bothering you.

Hi. I has just worked with new version of dhtml connector. Combobox is a great feature which you added.
But when testing it, i discovered something very interesting.
When loading dhtmlxgrid with a table has 2 comlumns, and both their type is "co", it will working well.
But when set 1 type is different "co" and 1 left is "co", the one set "co" won't load data from server in combobox.

This is your example:
File 06a_combo.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>For demo purpose only :: &1</title>




<script src="../common/dhtmlx.js" type="text/javascript" charset="utf-8"></script>
<script src="../../codebase/connector.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../common/dhtmlx.css" type="text/css" charset="utf-8">
</head>
<body>
                <div id="gridbox" width="350px" height="550px" style="background-color:white;overflow:hidden"></div>
<script>
    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setImagePath("../common/imgs/");
    mygrid.setHeader("Column A, Column B");
    mygrid.setInitWidths("100,*")
    mygrid.setColTypes("co,co");
======================================>> both of them are "co"

========================if one of their type differ "co" it will working nonproperly
    mygrid.setColSorting("connector,connector")
    mygrid.enableSmartRendering(true)
    mygrid.enableMultiselect(true)
    mygrid.init();
    mygrid.loadXML("06a_combo_connector.php");
    var dp = new dataProcessor("06a_combo_connector.php");
    dp.setUpdateMode("off")
    dp.init(mygrid);
</script>

And this is 06a_combo_connector.php file:
<?php
    require_once("../config.php");
    $res=mysql_connect($mysql_server,$mysql_user,$mysql_pass);
    mysql_select_db($mysql_db);
    require("../../codebase/grid_connector.php");
    
    
    
    $grid = new GridConnector($res);
    $grid->enable_log("temp.log",true);
    $grid->dynamic_loading(100);
    
    /*$filter1 = new OptionsConnector($res);
    $filter1->render_table("countries","item_id","item_id(value),item_nm(label)");
    $grid->set_options("item_nm",$filter1);*/
    
    
    $grid->set_options("item_nm",array("1","two","3"));
    $grid->set_options("item_cd",array("91"=>"one", "75"=>"two"));
    
    
    
    $grid->sql->set_transaction_mode("record");
    $grid->render_table("grid50000","item_id","item_nm,item_cd");
    
?>
I don't know it's my mistake or your problem. Can you test it again, please.
Thanks for your great work.
Answer posted by Stanislav (support) on Oct 07, 2009 09:35
Problem was confirmed and fixed. Please try to use attached js file instead of original one ( the same fix will be added to the next version of connector ) 
Attachments (1)