//画出表格
clientdatagrid.prototype.draw = function(id)
{
this.id=id;
var str = "<table rules='all' id = '" + id + "_datagrid' " +
(this.border !=null?("border=" + this.border):"") + " " +
(this.cellspace !=null?("cellspace=" + this.cellspace):"") + " " +
(this.cellpadding !=null?("cellpadding=" +this.cellpadding):"") + " " +
(this.width !=null?("width=" + this.width):"") + " " +
(this.height !=null?("height=" + this.height):"") + " " +
(this.bordercolor !=null?("bordercolor=" + this.bordercolor):"") + " " +
(this.css !=null?("style='" + this.css + "'"):"") + ">";
//画标题
str = str + "<tr " + (this.titlecss!=null?("style='" + this.titlecss + "'"):"") + ">";
for(var i = 0;i<this.colcount;i++)
{
str = str + "<td " + (this.colwidths[i]!=null?("width=" + this.colwidths[i]):"") + " " +
(this.titleitemcss!=null?("style='" + this.titleitemcss + "' "):"") + ">" + this.titlerow[i] + "</td>";
}
str = str + "<td " + (this.titleitemcss!=null?("style='" + this.titleitemcss + "' "):"") + ">选中</td>";
str = str + "<td " + (this.titleitemcss!=null?("style='" + this.titleitemcss + "' "):"") + ">删除</td>";
str = str + "</tr>" ;
//画单元格
for(var i = 0 ; i < this.rowcount; i++)
{
str = str + "<tr id = 'row"+ i + "' " + (this.rowheight!=null?("height=" + this.rowheight):"") + " " +
(this.rowcss!=null?("style='" + this.rowcss + "'"):"") + ">";
for(var j=0;j<this.colcount;j++)
{
if(this.inputcols[j] == 1)
str = str + "<td " + (this.itemcss!=null?("style='" + this.itemcss + "' "):"") + "><input language='javascript' type=text value='" + this.rows[i].data[j] + "' onblur='"+this.id+".cellchange("+j+","+i+",this.value)'></td>";
if(this.inputcols[j] == 0)
str = str + "<td " + (this.itemcss!=null?("style='" + this.itemcss + "' "):"") + ">" + this.rows[i].data[j] + "</td>";
}
str = str + "<td " + (this.itemcss!=null?("style='" + this.itemcss + "' "):"") + "><input language='javascript' type=button value='选中' onclick='" + this.id + ".selectrow(" + i + ")'></td>";
str = str + "<td " + (this.itemcss!=null?("style='" + this.itemcss + "' "):"") + "><input language='javascript' type=button value='删除' onclick='" + this.id + ".deleterowat("+ i + ")'></td>";
str = str + "</tr>";
}
str = str + "</table>";
thi