A kick Google search this morning shows me that I was wrong..:) I was thinking the onInitializationForm was a grid Event and not a NavGrid event…
I should be ok by now
I should have search more before posting, sorry for the trouble.
The code (without moving to selectedIndex, just hooking on onInitializeForm) :
jQuery(â€#grid-equipementâ€).navGrid(â€#pager-equipementâ€,
{refresh: true, edit: true, add: true, del: true, search: false, position:â€leftâ€},
{onInitializeForm:function(formId){alert(’ok’);}});
Thanks for you time
Solution (because I hate when I find a post in a forum that talks about my problem but didn’t explain how to fix it.
)
NOTE : I use the pluggin to manipulate the select
http://www.texotela.co.uk/code/jquery/select/
jQuery(â€#grid-equipementâ€).navGrid(â€#pager-equipementâ€,
{refresh: true, edit: true, add: true, del: true, search: false, position:â€leftâ€},
{
// Edit option.
beforeShowForm:function(formId){
//$(â€#dateFabricationâ€, formId).datepicker({dateFormat:â€yyyy-mm-ddâ€});
// Ajustement des selects.
var rowId, selectValue;
rowId = $(â€#grid-equipementâ€).getGridParam(â€selrowâ€);
// Type équipement.
selectValue = $(â€#grid-equipementâ€).getCell(rowId, 5);
$(â€#typeIdâ€).selectOptions(selectValue, true);
// Fournisseur.
selectValue = $(â€#grid-equipementâ€).getCell(rowId, 7);
$(â€#fournisseurIdâ€).selectOptions(selectValue, true);
},
},
{
// Add option.
});