problem con drowdop

Questionsproblem con drowdop
Sergio Pulido asked 10 years ago

$col = array();
$col["title"] = "IdCliente";
$col["name"] = "IdCliente";
$col["dbname"] = "diario_detalles.IdCliente"; // this is required as we need to search in name field, not id
$col["width"] = "100";
$col["align"] = "left";
$col["search"] = true;
$col["editable"] = true;
$col["edittype"] = "select"; // render as select
# fetch data from database, with alias k for key, v for value
$str = $g->get_dropdown_values("select distinct IdCliente as k, Nombre as v from ha_clientes");
$col["editoptions"] = array("value"=>":;".$str);
$col["formatter"] = "select"; // display label, not value
$cols[] = $col;
Hi, I have the following error:
PHP Fatal error: Call to a member function get_dropdown_values () on a non-object
my code, es copy del example

$g->select_command = "select diario_entradas.IdEntrada, diario_entradas. Albaran, diario_entradas.IdCliente , diario_entradas.Contenedor, diario_entradas.Fechallegada FROM diario_entradas inner join ha_clientes on
ha_clientes.IdCliente = diario_entradas.IdCliente";

$grid["width"] = "1200";
// disable all dialogs except edit

// set database table for CRUD operations

$g->table = "diario_entradas";

2 Answers
Abu Ghufran answered 10 years ago

Please make sure:
1) You are using full version of jqgrid_dist.php (that has full expanded code)
2) $g = new jqgrid() must be defined before using with get_dropdown_values

Sergio Pulido answered 10 years ago

thank you very much!. It's ok
Sergio Pulido.

Your Answer

13 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?