1
我在網格中的文本框 - > RadTextBoxSandi設定值文本框在網格中的JavaScript
<telerik:RadGrid ID="gridlist" runat="server" AutoGenerateColumns="false" AllowSorting="true" Width="100%" PageSize="50" AllowPaging="true"
OnPageIndexChanged="gridlist_PageIndexChanged" OnItemDataBound="gridlist_OnItemDataBound">
<MasterTableView DataKeyNames="ID_DANA_MASUK" AllowPaging="true" AllowSorting="true">
<NoRecordsTemplate>
Data tidak ada...
</NoRecordsTemplate>
<Columns>
<telerik:GridTemplateColumn HeaderText="DANA MASUK">
<HeaderTemplate>
<input type="checkbox" id="ButSelect" name="ButSelect" value="Check All" onclick="CheckAll()">
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkItemSelect" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="ID DANA MASUK">
<ItemTemplate>
<asp:Label runat="server" ID="LBLIDDANAMASUK" Text='<%# Bind("ID_DANA_MASUK") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="REFERENCE NUMBER">
<ItemTemplate>
<asp:Label runat="server" ID="LBLREFERENCE_NUMBER" Text='<%# Bind("REFERENCE_NUMBER") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="TGL_TRANSAKSI" HeaderText="TGL TRANSAKSI"/>
<telerik:GridBoundColumn DataField="NAMA_PEMILIK" HeaderText="NAMA PEMILIK"/>
<telerik:GridBoundColumn DataField="NO_REK" HeaderText="NO REK"/>
<telerik:GridBoundColumn DataField="VALUTA_TRANSFER" HeaderText="VALUTA TRANSFER"/>
<telerik:GridBoundColumn DataField="NOMINAL_TRANSFER" HeaderText="NOMINAL TRANSFER"/>
<telerik:GridBoundColumn DataField="VALUTA_DITERIMA" HeaderText="VALUTA DITERIMA"/>
<telerik:GridBoundColumn DataField="NOMINAL_DITERIMA" HeaderText="NOMINAL DITERIMA"/>
<telerik:GridBoundColumn DataField="NAMA_PENGIRIM" HeaderText="NAMA PENGIRIM"/>
<telerik:GridBoundColumn DataField="NAMA_BANK_PENGIRIM" HeaderText="NAMA BANK PENGIRIM"/>
<telerik:GridBoundColumn DataField="BERITA" HeaderText="BERITA"/>
<telerik:GridTemplateColumn HeaderText="PEMBAYARAN">
<ItemTemplate>
<asp:Label ID="LBLPEMBAYARAN" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="SANDI KETERANGAN">
<ItemTemplate>
<telerik:RadTextBox ID="RadTextBoxSandi" runat="server" onclick="openWin();
return false;"></telerik:RadTextBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
</telerik:RadGrid>
,我想從我的radwindow參數設定值的文本框,當它關閉
function OnClientClose(oWnd, args) {
var arg = args.get_argument();
var grid = document.getElementById("<%=gridlist.ClientID %>");
if (arg) {
// grid.textContent = arg.Kode;
}
那麼,如何在JavaScript中設置網格列表中的RadTextBoxSandi?
UPDATE:
function FindElement() {
var grid = $find("<%=gridlist.ClientID %>");
var MasterTable = grid.get_masterTableView();
var length = MasterTable.get_dataItems().length;
for (var i = 0; i < length; i++) {
var RadTextBoxSandi = MasterTable.get_dataItems()[i].findElement("RadTextBoxSandi");//access the TextBox control
RadTextBoxSandi.innerText = "Test";// assigning value to TextBox control }
}
但
它讓我所有的文本框填充相同的值,任何人都知道如何將值設置爲選定的文本?
剛剛發佈呈現html輸出 –
澄清@ ChamikaSandamal的評論...如果這是一個JavaScript問題,那麼ASP代碼是無關緊要的,並且不是非常有用(如果有的話)。 –