Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by ram on Aug 05, 2008 17:06
open dhtmlx forum
dynamically populate combo in grid

I have a specific need to dynamically populate combo ONLY if the user selects a radio button.

Details -
The column types for each row looks like this -
mygrid.setColTypes("ro,ed,ed,ra_str,ra_str,ra_str,co");

I am populating the grid values from an array like this - mygrid.parse(array1, "jsarray");

Now when the user clicks the second radio, i would like to dynamically populate the last column which is of type combo. Can this be done? If yes, how?

Thanks,
Ram
Answer posted by Support on Aug 06, 2008 02:05

Not sure what do you meand by "dynamically", but in common case it can be done as

grid.attachEvent("onCheckbox",function(id,ind,state){
   if (ind==4 && state){
         //radio was clicked,
         var combo = grid.getCustomCombo(id,"6");
         combo.clear()
         combo.put(value,lablel)
         ....
   }
})