Forum


Now I´m trying to make dynamic dropdown but I have a problem, it loads only once
here is the code:
{name:'id384',index:'id384',
sortable:true,
editable:true,
edittype:”select”,
editoptions:{dataUrl:'Opc/HlpTabla.php?zTabla=st384',
dataEvents: [
{ type: 'change',
fn: function(e) {
alert($("#id384").val());
$("#id195").parent().load('Opc/HlpTabla.php?zTabla=st195&key=id384&val='+$("#id384").val());
}
}],}
},
{name:'id195',index:'id195',
sortable:true,
editable:true,
edittype:”select”,
editoptions:{value:{}}
},
The HlpTabla.php return something live “<select><option></option>…</select>”
Fisrt time it loads ok and works but if I change the id384 contents it doesn´t update the id195 select
Thanks for help me.
Martin
PD: I create a new topic because could be easier to follow
17:28

22/12/2008

Does your alert($("#id384").val()); is showing each time you're changing your dropdown?
according to document :
dataEvents: list of events to apply to the data element; uses
$("#id").bind(type, [data], fn) to bind events to data element
Should be described like this dataEvents: [
{ type: 'click', data: { i: 7 }, fn: function(e) { console.log(e.data.i); }
}, { type: 'keypress', fn: function(e) { console.log('keypress'); } }
]
The event(s) are called only once when the element is created
if you know your jquery object (the dropdow id etc ) you might be using live event of jquery.
06:33

Moderators
30/10/2007

Hello,
You do not answer of the question - does your alert show the changed value?
or
Should I think the you speak about the select in dataUrl?
I do not understand what you try to do
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:15

Hi man,
I have exactly the same problem, It loads the first time, but not the second.
The alert shows up every time i change the original select, but second select does not. It changes only on the first time.
Is this the only way to do a dynamic select? i'm trying to resolve the classic case of Zip-state-city.
any help?
10:20

Moderators
30/10/2007

Hello,
Do you have check in FireBug if the request is posted?
Also you should use load with care. Try to use the pure $.ajax and see the result.
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.
11:19

Hi tony, I have changed, now I'm using $.ajax (I have tried also with a standard javascript ajax function) and all go right, but now I have another problem.
I used the called to the function on the beforeShowForm event, but doing so the select doesnt fire the right value.
If I just close and reopen the form all go right.
Thank you in advance.
Most Users Ever Online: 715
Currently Online:
69 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