datagrid| Script | refresh | no refresh
A script to implement the "edit" and "Cancel" function of the DataGrid, with the aim of not generating page refreshes select from Brownyu Blog
Keyword section implements the "edit", "Cancel" feature script for the DataGrid, with the aim of not generating page refreshes
Source
A script to implement the "edit" and "Cancel" feature of the DataGrid, with the aim of not generating page refreshes
<script language= "JavaScript" >
var selectrow= "";
var SelectObject;
function Editcell (thisobject,type)
{
var id = thisobject.id;
var buttonid= "button" +type;
var row=id.replace (ButtonID, "");
if (type==1&&selectrow.length>0&&selectobject!=null)
{
Editrow (Selectrow,2,selectobject);
Selectrow= "";
}
if (type==1) {selectrow=row;selectobject=thisobject;} Else{selectrow= ""; selectobject=null;}
Editrow (Row,type,thisobject);
}
function Editrow (row,type,thisobject)
{
var visible1= "None";
var visible2= "inline";
if (type!=1)
{
visible1= "inline";
Visible2= "None";
}
var buttonid= "button" +type;
var style;
var i;
for (i=1;i<8;i++)
{
var name1=row+ "Img" +i;
Document.all[name1].getattribute ("style"). Display=visible1;
name1=row+ "Text" +i;
var name2=row+ "Checkbox" +i;
Document.all[name2].getattribute ("style"). Display=visible2;
if (type!=1)
{
if (document.all[name1].value==1)
Document.all[name2].checked=true;
Else
Document.all[name2].checked=false;
}
}
var tdindex = ThisObject.parentElement.cellIndex;
if (type>1) Tdindex = tdIndex-1;
Thisobject.parentelement.parentelement.cells[tdindex].getattribute ("style"). Display=visible2;
Thisobject.parentelement.colspan=type;
var name;
Name=row+buttonid;
Document.all[name].getattribute ("style"). display= "None";
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.