人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當前位置:蘿卜系統下載站 > 技術開發教程 > 詳細頁面

一段完成DataGrid的“編輯”、“取消”技巧腳本

一段完成DataGrid的“編輯”、“取消”技巧腳本

更新時間:2022-08-29 文章作者:未知 信息來源:網絡 閱讀次數:

<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";

if(type==1)
{
document.all[name].parentElement.parentElement.getAttribute("style").backgroundColor="LightYellow";
name=row+"Button2";
document.all[name].getAttribute("style").display="inline";
}
else
{
document.all[name].parentElement.parentElement.getAttribute("style").backgroundColor="";
name=row+"Button1";
document.all[name].getAttribute("style").display="inline";
}
}

</SCRIPT>
<asp:datagrid id="GridItem" runat="server" cellPadding="0" BorderStyle="Solid" AutoGenerateColumns="False"
Width="100%" AllowPaging="True">
<SelectedItemStyle BackColor="LightYellow"></SelectedItemStyle>
<EditItemStyle CssClass="tdbg-dark" BackColor="Ivory"></EditItemStyle>
<ItemStyle HorizontalAlign="Center" Height="23px" CssClass="tdbg"></ItemStyle>
<HeaderStyle HorizontalAlign="Center" Height="25px" CssClass="summary-title"></HeaderStyle>
<Columns>
<asp:BoundColumn DataField="id" ReadOnly="True" HeaderText="人員編號">
<HeaderStyle Width="120px"></HeaderStyle>
</asp:BoundColumn>
<asp:BoundColumn ReadOnly="True" HeaderText="姓名">
<HeaderStyle Width="120px"></HeaderStyle>
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="管理權">
<HeaderStyle Width="60px"></HeaderStyle>
<ItemTemplate>
<IMG id="Img1" style="DISPLAY: inline" alt='一段實現DataGrid的“編輯”、“取消”功能腳本' src="http://edu.chinaz.com/Get/Program/Net/Images/CheckBoxUnSelect.gif" runat="server"><INPUT id="Checkbox1" style="DISPLAY: none" type="checkbox" runat="server">
<INPUT id="Text1" type="text" runat="server" style="DISPLAY: none">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="查詢權">
<HeaderStyle Width="60px"></HeaderStyle>
<ItemTemplate>
<IMG id="Img2" style="DISPLAY: inline" alt='一段實現DataGrid的“編輯”、“取消”功能腳本' src="http://edu.chinaz.com/Get/Program/Net/Images/CheckBoxUnSelect.gif" runat="server"><INPUT id="Checkbox2" style="DISPLAY: none" type="checkbox" runat="server" NAME="Checkbox2">
<INPUT id="Text2" type="text" runat="server" style="DISPLAY: none" NAME="Text2">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="錄入權">
<HeaderStyle Width="60px"></HeaderStyle>
<ItemTemplate>
<IMG id="Img3" style="DISPLAY: inline" alt='一段實現DataGrid的“編輯”、“取消”功能腳本' src="http://edu.chinaz.com/Get/Program/Net/Images/CheckBoxUnSelect.gif" runat="server"><INPUT id="Checkbox3" style="DISPLAY: none" type="checkbox" runat="server" NAME="Checkbox3">
<INPUT id="Text3" type="text" runat="server" style="DISPLAY: none" NAME="Text3">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="修改權">
<HeaderStyle Width="60px"></HeaderStyle>
<ItemTemplate>
<IMG id="Img4" style="DISPLAY: inline" alt='一段實現DataGrid的“編輯”、“取消”功能腳本' src="http://edu.chinaz.com/Get/Program/Net/Images/CheckBoxUnSelect.gif" runat="server"><INPUT id="Checkbox4" style="DISPLAY: none" type="checkbox" runat="server" NAME="Checkbox4">
<INPUT id="Text4" type="text" runat="server" style="DISPLAY: none" NAME="Text4">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="刪除權">
<HeaderStyle Width="60px"></HeaderStyle>
<ItemTemplate>
<IMG id="Img5" style="DISPLAY: inline" alt='一段實現DataGrid的“編輯”、“取消”功能腳本' src="http://edu.chinaz.com/Get/Program/Net/Images/CheckBoxUnSelect.gif" runat="server"><INPUT id="Checkbox5" style="DISPLAY: none" type="checkbox" runat="server" NAME="Checkbox5">
<INPUT id="Text5" type="text" runat="server" style="DISPLAY: none" NAME="Text5">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="導出權">
<HeaderStyle Width="60px"></HeaderStyle>
<ItemTemplate>
<IMG id="Img6" style="DISPLAY: inline" alt='一段實現DataGrid的“編輯”、“取消”功能腳本' src="http://edu.chinaz.com/Get/Program/Net/Images/CheckBoxUnSelect.gif" runat="server"><INPUT id="Checkbox6" style="DISPLAY: none" type="checkbox" runat="server" NAME="Checkbox6">
<INPUT id="Text6" type="text" runat="server" style="DISPLAY: none" NAME="Text6">
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="導入權">
<HeaderStyle Width="60px"></HeaderStyle>
<ItemTemplate>
<IMG id="Img7" style="DISPLAY: inline" alt='一段實現DataGrid的“編輯”、“取消”功能腳本' src="http://edu.chinaz.com/Get/Program/Net/Images/CheckBoxUnSelect.gif" runat="server"><INPUT id="Checkbox7" style="DISPLAY: none" type="checkbox" runat="server" NAME="Checkbox7">
<INPUT id="Text7" type="text" runat="server" style="DISPLAY: none" NAME="Text7">
</ItemTemplate>
</asp:TemplateColumn>
<asp:ButtonColumn Text="保存" HeaderText="操作" CommandName="cmdSave">
<ItemStyle Font-Size="10pt"></ItemStyle>
</asp:ButtonColumn>
<asp:TemplateColumn>
<ItemTemplate>
<INPUT id="Button1" style="cursor: hand; WIDTH: 35px; COLOR: blue; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline; BORDER-BOTTOM-STYLE: none"
onclick="EditCell(this,1);" type="button" value="編輯" runat="server"><INPUT id="Button2" style="cursor: hand; DISPLAY: none; COLOR: blue; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline; BORDER-BOTTOM-STYLE: none"
onclick="EditCell(this,2);" type="button" value="取消" runat="server">
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle NextPageText="下一頁" PrevPageText="上一頁"></PagerStyle>
</asp:datagrid>

 


溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

網站地圖xml | 網站地圖html
主站蜘蛛池模板: 诸暨市| 定西市| 黑河市| 阿拉善右旗| 五河县| 祁阳县| 宜良县| 宽甸| 筠连县| 蒲江县| 浪卡子县| 仁怀市| 岳池县| 扶余县| 绵竹市| 交城县| 张家港市| 泽库县| 望奎县| 同心县| 涟水县| 申扎县| 赤城县| 湖北省| 北流市| 涿鹿县| 图木舒克市| 双流县| 安陆市| 攀枝花市| 观塘区| 腾冲县| 乐业县| 海宁市| 库尔勒市| 叙永县| 宁武县| 雷波县| 靖江市| 桑日县| 扎兰屯市|