0

I am developing a web application using JSP & Servlet (IDE: Eclipse, Database: Oracle10). I am using jqGrid to display records in tabular format.

code snippet:

{name:'CITY',index:'CITY', width:70,editable:true,edittype:"select",editoptions: {dataUrl: 'ProfileServ?action=comboCity', dataEvents: [{  type: 'change', fn: function(e) {alert(this.value);city= this.value;}}],}}, 
{name:'PIN',index:'PIN', width:200,sortable:false,editable:true, edittype:"select",editoptions: {dataUrl: 'ProfileServ?action=comboPin'}},

I want to change values of PIN according to the value selected in CITY. I have used dataEvents and type: 'change' to get the selected value of CITY. I am successfully getting the selected value of CITY.

My question is that how should I update the values of PIN when value of CITY is changed?

Bhushan
  • 6,151
  • 13
  • 58
  • 91

1 Answers1

1

Unfortunately there is no easy way to implement dependent selects. One have to update the whole <select> of dependent select manually inside of change callback (update selects of PIN in your case). The only which I can suggest you is examining the code of the demo from the answer. It is not exactly what you need because it don't use dataUrl, but it shows what should be done.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • +1 for answering(and Thanks again), I read most of your answers related to this question before asking this question, and I had already seen your demo, but still before asking this question I thought that there might be a way in `jqgrid` to accomplish this task. now I think I have to change my code according to your `demo` and `answers`. – Bhushan Feb 06 '13 at 09:48