<body>
<html:form method="post" action="funddis.php">
<table>
<tr>
<td align="left">
<html:select property="fundcorp" onchange="cmdChgcorp()">
<html:options collection="complist" property="corpid" labelProperty="corpname"></html:options>
</html:select>
</td>
<td>
<html:select property="fundinfos">
</html:select>
</td>
<td>
  <input type="button" value="保存任务" onclick="save()">
</td>
</tr>
</table>
 <div>     
        <div id="gridbox"   width="100%" height="90%"  ></div>      
            </div>
</html:form>
</body><script type="text/javascript">
              
       function cmdChgcorp(){
var fundcorp = document.getElementById('fundcorp').value;
if(fundcorp == "all"){
var option=document.createElement("option");
option.appendChild(document.createTextNode("没有什么基金列表显示"));
fundinfos.appendChild(option);
}
else
{
var url = "servlet/fundcorpinfo?fundcorp="+fundcorp;
var ajaxObj = new Ajax.Request(url,   {     
method:'get',
onSuccess:function(transport)
{       
var response = transport.responseText || "no response text";
if(response == "-1"){
var option=document.createElement("option");
            option.appendChild(document.createTextNode("该基金公司下没有任何基金列表!"));
            fundinfos.appendChild(option);
return ;
}
else{
var json =  transport.responseText.evalJSON(); //返回产品数组
if(json == undefined || json.infos.length == 0){
var option=document.createElement("option");
                option.appendChild(document.createTextNode("该基金公司下没有任何基金列表!"));
                fundinfos.appendChild(option);
return ;
}
else
{
document.getElementById('fundinfos').options.length=0;
alert("XXXXX"+json.infos.length);
for( var i=0; i<json.infos.length; i++ )
{
   alert("XXXXX"+json.infos.length);
    var option=document.createElement("option");
    option.setAttribute("value",json.infos[i].fundno);
    option.appendChild(document.createTextNode(json.infos[i].fundname));
    fundinfos.appendChild(option);
    }
}
}
},     
onFailure: function()

alert('系统错误,请联系管理员...') ;
},
onComplete: function()
{  

}
}
);
}
}
              
              
              
              
              
              
              
              
              

        mygrid = new dhtmlXGridObject('gridbox');
        mygrid.setNumberFormat("¥0,000.00",2);
        mygrid.setNumberFormat("¥0,000.00",3);
        mygrid.setNumberFormat("¥0,000.00",4);
           mygrid.enableMultiselect(false); 
          mygrid.imgURL = "codebase/imgs/grid/icons_greenfolders/";
          var fundinfos = document.getElementById('fundinfos').value;
          mygrid.loadXML("servlet/reduce?comno=${comno}&codno="+fundinfos);  
        
              function save(){
                 var expond = "";
                 for(var i=0;i<mygrid.getRowsNum();i++){
       var id = mygrid.getRowId(i);
       var value1 = mygrid.cells2(i,1).getValue();
       var value2 = mygrid.cells2(i,2).getValue();
       var value3 = mygrid.cells2(i,3).getValue();
     expond += (expond.length == 0)? (id + "," + value+","+value1+","+value2) : ("|" + id + "," + value+","+value1+","+value2);
 }
              window.location.href="funddis.php?action=savetask&codno="+fundinfos+"&expond=" + expond;;
         }</script>
</html>