<pre name="code" class="javascript">
function initRole(){
var types=type.getValue();
if (types != null && types != ''){
url1=“url路径”;
paramValue='checked = true ';
return getData(url1,paramValue);
}
}
function getData(url,paramValue){
var code="";
var name="";
Ext.Ajax.request({ url:url, method:'POST', async:false, params:{'_queryCondition':paramValue},
success:function(form,action){
var datas = Ext.util.JSON.decode(form.responseText);
if(datas.length>0){
code = datas[0].code; name = datas[0].name;
} } });
return code + "," + name; }