Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Dec 01, 2009 04:25
open dhtmlx forum
fetch data in combo box from database

Hello,

I have fetch data from database to my #connector_select_filter drop down box. but it gives me erroor [OprionConnector] class is not defined
please tell me wht i do i alm sending u my code

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<link rel='STYLESHEET' type='text/css' href='../dhtmlxGrid/codebase/dhtmlxgrid.css'>

<link href='../dhtmlxGrid/codebase/ext/dhtmlxgrid_pgn_bricks.css' rel='STYLESHEET' type='text/css'>

<script src='../dhtmlxGrid/codebase/dhtmlxcommon.js'></script>

<script src='../dhtmlxGrid/codebase/dhtmlxgrid.js'></script>

<script src='../dhtmlxGrid/codebase/dhtmlxgridcell.js'></script>

<script src='../dhtmlxGrid/codebase/ext/dhtmlxgrid_srnd.js'></script>

<script src='../dhtmlxDataProcessor/codebase/dhtmlxdataprocessor.js'></script>



<script src='../dhtmlxGrid/codebase/ext/dhtmlxgrid_filter.js'></script>

<script src='../dhtmlxConnector_PHP/codebase/connector.js'></script>



</head>



<body>



<div id="gridbox" style="width:1000px; height:902px;"></div>



<script>

mygrid = new dhtmlXGridObject('gridbox');

mygrid.setImagePath('dhtmlxGrid/codebase/imgs/');

mygrid.setHeader("ID,Name,shotID,shotstatus,taskid,taskref,userID,taskStatus,startdate,enddate,alloted mandays,task priority,next sub,actual mandays");
mygrid.attachHeader("#connector_text_filter,#connector_select_filter)
mygrid.setInitWidths("100,*")

mygrid.setColTypes("ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed,ed");

mygrid.setSkin("modern")

mygrid.attachHeader("#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter")

mygrid.setColSorting("connector,connector,connector")



mygrid.init();

mygrid.enableSmartRendering(true);

mygrid.loadXML("connector.php");

var dp = new dataProcessor("connector.php");

dp.init(mygrid);

</script>

</body>

</html>




and this is my connection file


<?php

require_once("../dhtmlxConnector_php/codebase/grid_connector.php");



$res=mysql_connect("localhost","root","");

mysql_select_db("sampledb");



$grid = new GridConnector($res);

$grid->dynamic_loading(100);

$filter1=new OptionsConnector($res);
$filter1->render_table("countries","country_id","country)name(value)");
$grid->set_oprions("item_nm",$filter1);
$grid->render_table("products","nm","code,num_val,shotid,shotstatus,taskid,taskref,tasknote,userid,taskstatus,start_date,end_date,alloted_mandays,task_priority,next_sub,actual_manday");

?>

plaese tell me what i do to fetch data in combo box .

Answer posted by Alex (support) on Dec 01, 2009 06:24

Hello,

there is the ready sample in the connector package. Please, have a look dhtmlxConnector_php/samples/grid/05a_select_filter.html