Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Jan 22, 2009 03:49
open dhtmlx forum
grid problem of state maintain i have a grid with data which has three column like A B C 1 Delhi New Delhi ...

grid problem of state maintain


i have a grid with data which has three column like

A B C

1 Delhi New Delhi

2 Haryana Chandigarh


A is srno , b is state and c is capital values

when i press f2 on first row on cell Delhi a popup is open with all sate of INDIA and its STATE CAPITAL.
in popup window radio button are there is check the radio button that row value of delhi , and new delhi seleted
on close of the popup window the value come on the parent grid.




var state = parent.mygrid.cells(parent.mygrid.getSelectedRowId(),1).getValue();
document.getElementById("radio_for_"+state).checked=true;


how i find the radio_for_"+state

if my xml column type is below

res += "<head> " +
"<column width='75' type='ra' align='center' >Select Train</column>" +
" <column width='50' type='ro' align='left' color='#d5f1ff' sort='str'>Train No</column> " +
" <column width='150' type='ro' align='left' sort='str'>Train Name</column> " +
" <column width='100' type='ro' align='left' sort='str' >Start Station</column> " +
" <column width='80' type='ro' align='left' sort='str'>End Station </column> " +
" <column width='80' type='ro' align='center' sort='int'>Departure Time</column> " +
" <column width='150' type='ro' align='center' >Arrival Time</column> " +
" <column width='150' type='ro' align='center' sort='int'>Over Night</column> " +
" <settings> " +
" <colwidth>px</colwidth> " +
" </settings> " +
" </head> ";
xml are generate at the run time with radio button so onRowcreted how I write the code

like this such that the actual radion button is auto checked when the row is created

var state = parent.mygrid.cells(parent.mygrid.getSelectedRowId(),1).getValue();
document.getElementById("radio_for_"+state).checked=true;






Answer posted by Support on Jan 22, 2009 05:55
>>how i find the radio_for_"+state 
You have mentioned that
>>in popup window radio button 
So you popup window has some system of radio buttons, right? If you creating them, they must have some unique IDs|names. The codeline 
     document.getElementById("radio_for_"+state).checked=true; 
just a sample, in real life you need to use some code which will return radio button object by its value.