November 2nd, 2014

Please consider registering

sp_LogInOut Log In

Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 4 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Dynamic Column Selects
Forum Posts: 7
Member Since:
sp_UserOfflineSmall Offline

Hi everyone,

First of all thanks for the great support and lessons i am getting with this forum, really helpful!

Im working for the first time with JqGrid and Im lost trying to get dynamic combos in 3 of my grid columns...I have read a lot of Topics about and they focus on the dynamic selects in the edit mode, so i couldnt find the solution for the "normal" column selects linking.

The thing, as you can image, is about a table with the columns  "Region" "City" "Hospital", the selects get the options from a sql table but they are not linked and when the user select a region the second select is still displaying all the cities of the country, not only the cities relatives to that region, and the same with City and Hospital...I think you know what i mean, you can see the app online here ""

I can post my code if you want, is there any chance to get that not so complicated (remember im new with JqGrid:)

Many thanks


PS: my grid.php code

// Connection to the server
// Tell the db that we use utf-8
$conn->query("SET NAMES utf8");
// Create the jqGrid instance
$grid = new jqGridRender($conn);
// Write the SQL Query
$grid->SelectCommand = 'SELECT Numero , Convocatoria, Especialidad, Provincia, Localidad, Centro FROM adjudicamir09';
// Set output format to json
$grid->dataType = 'json';
// Let the grid create the model
// Set the url from where we obtain the data
// Set some grid options
        "caption"=>"ConsultAmiR 09 | Abre este panel y busca lo que necesites! | MUCHA SUERTE | Equipo AMIR",

$grid->setColProperty("Numero", array("label"=>"Numero", "width"=>90, "search"=>true, "align"=>"center"));
$grid->setColProperty("Especialidad", array("label"=>"Especialidad", "width"=>200));
$grid->setColProperty("Provincia", array("label"=>"Provincia", "width"=>200));
$grid->setColProperty("Localidad", array("label"=>"Localidad", "width"=>150));
$grid->setColProperty("Centro", array("label"=>"Centro", "width"=>500));
$grid->setColProperty("Convocatoria", array("label"=>"Convocatoria", "width"=>90, "align"=>"center"));

// Enable filter toolbar searching
$grid->toolbarfilter = true;

// we set the select

$grid->setSelect("Localidad", "SELECT DISTINCT Localidad, Localidad AS Provincia FROM adjudicamir09 ORDER BY `adjudicamir09`.`localidad` ASC", false, false, true, array(""=>"Todas"));
$grid->setSelect("Provincia", "SELECT DISTINCT Provincia, Provincia AS Provincia FROM adjudicamir09 ORDER BY `adjudicamir09`.`Provincia` ASC", true, true, true, array(""=>"Todas"));
$grid->setSelect("Especialidad", "SELECT DISTINCT Especialidad, Especialidad AS Especialidad FROM adjudicamir09 ORDER BY `adjudicamir09`.`Especialidad` ASC", false, false, true, array(""=>"Todas"));
$grid->navigator = true;
$grid->setNavOptions('navigator', array("excel"=>false,"add"=>false,"edit"=>false,"del"=>false,"view"=>true, "search"=>true));
$grid->setSelect("Centro", "SELECT DISTINCT Centro, Centro AS Centro FROM adjudicamir09 ORDER BY `adjudicamir09`.`Centro` ASC", false, false, true, array(""=>"Todos"));
$grid->setSelect("Convocatoria", "SELECT DISTINCT Convocatoria, Convocatoria AS Convoctoria FROM adjudicamir09 ORDER BY `adjudicamir09`.`Convocatoria` DESC", false, false, true, array(""=>"Todas"));

$grid->renderGrid('#grid','#pager',true, null, null, true,true);
$conn = null;


Sofia, Bulgaria
Forum Posts: 7721
Member Since:
sp_UserOfflineSmall Offline


Please refer here:;ret=all



For professional UI suites for PHP, ASP.NET and ASP.NET MVC visit us at our commercial products site - - by the very same guys that created jqGrid.
Forum Timezone: Europe/Sofia

Most Users Ever Online: 215

Currently Online:
86 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members: razia, Prankie, psky, praveen neelam,, swathi

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information