有固定的table。想通过ajaxpro把返回dataset绑定到table。请有做过的提供源码参考参考。谢谢

解决方案 »

  1.   

    function show_callback(response)
    {
        var ds = response.value;
        if(ds!=null && typeof(ds)=="object"&& ds.Tables!=null)
        {
            for(var i=0;i<ds.Tables[0].Rows.length;i++)
            {
                var id = ds.Tables[0].Rows[i].USERID;
                var name = ds.Tables[0].Rows[i].USERNAME; 
                循环添加到table
            }
        }
    }
      

  2.   

    TO jc15271149(嘿咻):我就是不知怎么增加到table里,请问你有例子吗
      

  3.   

    <table id="table1">
     <tr id="Otr">
      <td>设备名称</td>
      <td>设备类型</td>
     </tr>
    </table>function DoDemo()
    {
    MDevicesWeb.WebForm1.Bind(callback);
    }
    function callback(response)
    {
       var ds = response.value;
       if(ds != null && typeof(ds) == "object" && ds.Tables != null)
       {
          for(var i=0; i<ds.Tables[0].Rows.length; i++)
          {
    otr = table1.insertRow(table1.rows.length);
    otd = otr.insertCell();
    otd.innerText = ds.Tables[0].Rows[i].DeviceName;
    otd = otr.insertCell();
    otd.innerText = ds.Tables[0].Rows[i].DeviceClassName;
           }
    }
    }
      

  4.   

    用ajaxpro的dataset,需要自己去写table ,不能直接绑定,用ajaxhelper试试