2010年3月29日 星期一

抓取 RadGrid 的欄位內容

關鍵點有兩個:

若是資料有多筆的話:
第一個是要抓到 get_selectedItems()[i] 擷取到對應的 item
第二步透過
getCellByColumnUniqueName 並配合對應的 item 與 uniqueName 抓出 innerHTML值

for (i = 0; i < masterTable.get_selectedItems().length ; i++) {
selectedItem = masterTable.get_selectedItems()[i];
alert(masterTable.getCellByColumnUniqueName(selectedItem, "ID_EMP").innerHTML );
}
若是資料僅有一筆的話:
哪就改為抓取第 0 筆, get_selectedItems()[0] 擷取到對應的 item


沒有留言:

張貼留言