Grid combo and OptionsConnector

Hi ! Problem with grid combo type column . Where it can be problem ?

<?php
   require( "php/codebase/grid_connector.php" );
   require( "php/codebase/db_mysqli.php" );
   require( "php/codebase/options_connector.php");
   
   $slc_fld = $_REQUEST[ 'lauku_eile' ];
   $link    = mysqli_connect( "localhost", "root", "", "engel" );
   if ( mysqli_connect_errno() )
   {
      printf( 'Prisijungimo klaida : %s\n', mysqli_connect_error() );
      exit();
   }
   $grid = new GridConnector( $link, "MySQLi" );
   $options = new OptionsConnector( $link );
   //$options->render_sql("SELECT taskName FROM tasks","","taskName,taskName");
    $options->render_sql( "select preke from prekes where prek_tipas = 'Gaminys' order by preke", "", "preke,preke" );
   /*
   Tried and :
    $options->render_sql( "select preke from prekes where prek_tipas = 'Gaminys' order by preke", "preke", "preke(value),preke(label)" );
   */
    $grid->set_options( "preke", $options );   
   $grid->dynamic_loading( 100 );
   $grid->render_table( "uzsakym", "uzsak", $slc_fld );
   mysqli_close( $link );
?>

Script :

      var mygrid = tabbar.cells( tabbar.getActiveTab() ).attachGrid();
      mygrid.setImagePath( "codebase/imgs/" );
      mygrid.setSkin( "dhx_skyblue" ); 
      mygrid.setColumnIds( slc_fld )
      mygrid.setHeader( grd_set[ 1 ] );
      mygrid.attachHeader( grd_set[ 2 ] );
      mygrid.setColTypes( grd_set[ 3 ] );
      mygrid.setColSorting( grd_set[ 4 ] );
      mygrid.setInitWidths( grd_set[ 5 ] )
      mygrid.setColAlign( grd_set[ 6 ] )
      mygrid.setColumnsVisibility( grd_set[ 7 ] );
      mygrid.enableSmartRendering( true, 100 );
      mygrid.init();
      mygrid.load( "uzs1.php?lauku_eile=" + slc_fld );
      myDp = new dataProcessor( "uzs1.php?lauku_eile=" + slc_fld );
      myDp.init( mygrid );
      myDp.enableDataNames( true );

      mygrid.enableMultiselect( true );
      mygrid.enableHeaderMenu();
      mygrid.enableColumnMove( true );
      mygrid.enableUndoRedo();

The column “preke” is set to “co” type and attached header - “#connector_text_filter” . When I try to update value , only existing value appears in combo box . No others values . Sql for items - good , tried .

With best regards !

Hi ! Can you help with this problem ? Any comment ?

Also want to say : Pro version, build 110713

Please , help in this situation …

Hi,

the problem is not clear enough. Please take a look at the similar sample in connector package:

dhtmlxConnector_php_v10_110725/php/samples/grid/05a_select_filter.html

What should be done to reproduce the problem in this sample?

Hi . I’m getting only 110713 build . Where I can get new build ?

The problem is from here : docs.dhtmlx.com/doku.php?id=dhtm … ns_in_grid

I did the same , but mine “co|coro” column select box of options is empty .

Mine log :

====================================
Log started, 13/07/2012 05:07:08
====================================
SELECT  preke,pav_lt FROM prekes WHERE ( prek_tipas = 'Gaminys') ORDER BY `preke` ASC

mysql_query() expects parameter 2 to be resource, object given at C:\wamp\www\engel\php\codebase\db_common.php line 916

mysql_fetch_assoc() expects parameter 1 to be resource, null given at C:\wamp\www\engel\php\codebase\db_common.php line 926

SELECT DISTINCT `svarbus` as value FROM uzsakym

SELECT DISTINCT `specai` as value FROM uzsakym

SELECT DISTINCT `mazi` as value FROM uzsakym

SELECT DISTINCT `uzs_data` as value FROM uzsakym

SELECT DISTINCT `uzs_sav` as value FROM uzsakym

SELECT DISTINCT `graz_data` as value FROM uzsakym

SELECT DISTINCT `graz_sav` as value FROM uzsakym

SELECT DISTINCT `fakt_data` as value FROM uzsakym

SELECT DISTINCT `fakt_sav` as value FROM uzsakym

SELECT DISTINCT `kerpa` as value FROM uzsakym

SELECT DISTINCT `subrang` as value FROM uzsakym

SELECT DISTINCT `aud_nuras` as value FROM uzsakym

SELECT DISTINCT `frn_nuras` as value FROM uzsakym

SELECT DISTINCT `invc_nuras` as value FROM uzsakym

SELECT DISTINCT `nav_nuras` as value FROM uzsakym

SELECT DISTINCT `pasel_prad` as value FROM uzsakym

SELECT DISTINCT `pokav_prad` as value FROM uzsakym

SELECT `uzsak`,`uzsak`,`telkinys`,`preke`,`uzs_kiekis`,`svarbus`,`specai`,`mazi`,`uzs_spalv`,`uzs_data`,`uzs_sav`,`graz_data`,`graz_sav`,`fakt_data`,`fakt_sav`,`pastabos_ord`,`zymos`,`kerpa`,`sukirp_lap`,`subrang`,`aud_nuras`,`frn_nuras`,`invc_nuras`,`nav_nuras`,`pasel_prad`,`pokav_prad`,`plan_modelis`,`pastabos_buh`,`pastabos_zs` FROM uzsakym LIMIT 0,100

SELECT COUNT(*) as DHX_COUNT  FROM uzsakym

Thanks …

Hello,

I meant the sample in Connector package:

dhtmlx.com/docs/products/dhtmlxC … ndex.shtml

The latest version is 1.5. Please check the sample in this package 1.5 package:

dhtmlxConnector_php_v15_120612/php/samples/grid/06_combo.html

OK . I redid the sample with mine db … Attached .

Iliustartion of problem :

As you can see in grid are many items , underlined in red . But select option in edit mode is emty , only cell value .

The first column is set as “co” only . Here select options are . But it’s only values from table .

Option Connector with grid isn’t working … Here you have a bug .

With best regards !

Wanted to add php in the first reply . But not allowed … . Zipped now … :slight_smile:
06_combo_connector.zip (438 Bytes)

Also forget to add log of this sample …
temp_log.zip (426 Bytes)

Any comments , Alexandra ?

Hi,

You need to set driver type for OptionsConnector as well as for GridConnector connector. It should be “MySQLi” in your app:

$filter1 = new OptionsConnector($res,“MySQLi”);

Hi,

Thanks for reply . I did what you say - it’s better . Now render_table for options is working . But I must notice , that all samples in documentation are without this parameter for OptionConnector . it’s misleading .

Well … But I need to select as options only part of table - render_sql is not working . Log direct that :

====================================
Log started, 19/07/2012 03:07:49
====================================
SELECT  preke FROM prekes WHERE ( prek_tipas = 'Gaminys') ORDER BY `preke` ASC
Undefined index: value at C:\wamp\www\engel\php\codebase\base_connector.php line 243

I found that : viewtopic.php?f=14&t=11644

This “as value”, “as label” solved mine problem . But again - documentation about that nothing say , again it’s misleading , waste of time as mine and as your …

Thanks , it seems that all is working OK . Regards !

Hi,

sorry for inconveniences. We’ll necessary add this information in documentation.