Forum


08:07

07/04/2009

Hello,
First thanks for this great work, i try several things very useful with jqgrid and it's a great ajax grid.
However, i have a problem with chained select box. I use the dialog form to add/edit data in the grid, and I have 2 select boxs that i want chained.
I tried events like intializeForm without succes. If someone could show me the way to search or give a few exemples it will be great.
I just want to load data from php script on change of a select box and load in a second select box.
Thanks,
Samuel
P.S : Please excuse my english, i tried to be explicit, if you don't understand i can explain my problem in another way.
08:45

Moderators
30/10/2007

Hello,
In onInitializeForm is the right place to do this. Could you please post the code?
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
09:08

07/04/2009

Thanks for your answer, this is the code i use :
).navGrid(”#nav_diplome_agricole”,
{search:false,refresh:false}, // Options
{reloadAfterSubmit:false}, // Options d\\'édition
{reloadAfterSubmit:false}, // Options d\\'ajout
{reloadAfterSubmit:false}, // Options de suppression
{}, // Options de recherche
{onInitializeForm :function(form_id){
$(”#etablissement_diplome_id_etablissement_diplome”, form_id).change(function(){
// alert(”Test”);
var id_etablissement_diplome = “”;
$(”#etablissement_diplome_id_etablissement_diplome option:selected”).each(function () {
id_etablissement_diplome = $(this).val();
});
// Appel du script php et récupération du code HTML généré
var html_liste = $.ajax({
url: “ajax/chargement.php?id_etablissement=”+id_etablissement_diplome,
async: false
}).responseText;
$(”#diplome_id_diplome”).html(html_liste);
})
}}
);
#etablissement_diplome_id_etablissement_diplome = id of my first select box
#diplome_id_diplome = id of my second select box
chargement.php is a script witch return html code of second select box
Perhap's there is already more information in the doc, but i don't find it.
Thanks a lot
Samuel
02:25

Moderators
30/10/2007

Hello,
Not sure, but take a look in the ajax, maybe you need
$.ajax({
...
complete: function(response, stat) {
$(”#diplome_id_diplome”).html(response.responseText);
}
...
});
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
08:22

07/04/2009

Hello,
Thanks for your answer Tony and for the time you spend in support.
About my problem, it seems that i don't use onInitializeForm correctly.
In fact, if i try this :
{onInitializeForm:function(form_id){
alert("Test");
}}
Nothing append, i already try something simple like :
{onInitializeForm:function(form_id){
html_liste = "<span>Test</span>";
$("#diplome_id_diplome").html(html_liste);
}}
Is there any example i can use somewhere to continue my search ?
Thanks a lot,
Sam
03:16

Moderators
30/10/2007

Hello,
If I see your previous post - Yes you do not use the event in the right place.
The princip is to include the event in the appropriate options and not at end.
Here is the example:
).navGrid(”#nav_diplome_agricole”,
{search:false,refresh:false}, // Options
{reloadAfterSubmit:false,
onInitializeForm: function (formid) {
// do something here
}
}, // Options d\\'édition
{reloadAfterSubmit:false,
onInitializeForm : function (formid){
// do something here
}
}, // Options d\\'ajout
{reloadAfterSubmit:false}, // Options de suppression
{}
);
Hope this helps
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
156 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, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66