2012-06-17 2 views

답변

1

이에 open issue이 있지만

여기

자신의 스크립트를 약간 수정 된 버전에 적응이다 (로맹 Vialard, 가스 TC에 의해 발견)가 좋은 해결 방법은 ;-)도있다 스프레드 시트에서 실행하십시오 radioValue 항목이 텍스트 상자 또는 숨겨진 텍스트가 될 수 있다는

function radiotest() { 
    var app = UiApp.createApplication(); 
    var panel = app.createVerticalPanel(); 
    var radioValue = app.createTextBox(); 
    radioValue.setId("radioValue").setName("radioValue");    
    // var radioValue = app.createHidden().setName("radioValue") ;// choose the one you like 
    for(var i = 1; i < 10; i++){ 
    var name = 'choice '+i; 
    var handler = app.createClientHandler().forTargets(radioValue).setText(name); 
    panel.add(app.createRadioButton('radioButtonGroup',name).addValueChangeHandler(handler)); 
    } 
    panel.add(radioValue); 
    var Valide=app.createButton("Valide").setId("val"); 
    panel.add(Valide)     
    app.add(panel); 
//    
    var handler = app.createServerHandler("valide"); // this is the server handler 
    handler.addCallbackElement(radioValue) 
    Valide.addClickHandler(handler); 
// 
    SpreadsheetApp.getActiveSpreadsheet().show(app);// show app 
    } 
    // 
function valide(e){ ;// This function is called when key "validate" is pressed 
    var sh = SpreadsheetApp.getActiveSheet(); 
    var RadioButton = e.parameter.radioValue;    
    sh.getRange('A1').setValue(RadioButton); 
    var app = UiApp.getActiveApplication(); 
    return app; 
}​ 

주, 둘 다 가능성은/스크립트에

+0

M 코드와 오픈 이슈 소스에 대한 감사의 서지. – Richi

관련 문제