已淘汰。這個類別已淘汰,不應用於新的指令碼。
協作平台清單項目:網站清單頁面上的清單元素。
已淘汰的方法
方法 | 傳回類型 | 簡短說明 |
---|---|---|
| void | 刪除這個清單項目。 |
| Date | 傳回這個清單項目首次發布的日期。 |
| Date | 返回這則留言的上次更新日期。 |
|
| 取得這個清單項目的上層頁面。 |
| String | 取得這個 ListItem 的編號欄值。 |
| String | 針對已命名的資料欄取得這個 ListItem 的值。 |
|
| 設定這個清單項目的上層頁面。 |
|
| 針對編號欄設定這個 ListItem 的值, |
|
| 針對編號欄設定這個 ListItem 的值, |
已淘汰的方法
deleteListItem()
deleteListItem()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
刪除這個清單項目。
// This code sample deletes all list items from a List page // Running this code sample against a Page that is a standard web page will // cause getListItems() to throw an exception var page = SitesApp.getSite('demositeappsscript').getChildByName('mylistpage'); var items = page.getListItems(); for(var i = 0; i < items.length; i++) { items[i].deleteListItem(); }
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://sites.google.com/feeds
getDatePublished()
getDatePublished()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
傳回這個清單項目首次發布的日期。
var page = SitesApp.getSite('example.com', 'mysite').getChildByName('mylistpage'); var items = page.getListItems(); var date = items[0].getDatePublished();
回攻員
Date
:原始發布日期
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://sites.google.com/feeds
getLastUpdated()
getLastUpdated()
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
傳回這則留言的上次更新日期。
var page = SitesApp.getSite('example.com', 'mysite').getChildByName('mylistpage'); var items = page.getListItems(); var date = items[0].getLastUpdated();
回攻員
Date
:上次更新日期
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://sites.google.com/feeds
getParent()
getParent()
getValueByIndex(index)
getValueByIndex(index)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
取得這個 ListItem 的編號欄值。
var page = SitesApp.getSite("demositeappsscript").getChildByName("mylistpage"); var listItem = page.getListItems()[0]; // Remember that rows are 0 indexed. This returns the item in the first column // of the list. If an index that is greater than the number of columns is used, // the script will throw an "InvalidArgument: index" exception. var value = listItem.getValueByIndex(5);
參數
名稱 | 類型 | 說明 |
---|---|---|
index | Integer | 以便取得 |
回攻員
String
:該欄的值
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://sites.google.com/feeds
getValueByName(name)
getValueByName(name)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
針對已命名的資料欄取得這個 ListItem 的值。
var page = SitesApp.getSite("demositeappsscript").getChildByName("mylistpage"); var listItem = page.getListItems()[0]; // Suppose we have a column named "Owner" - this will let us fetch the value // for the list item var value = listItem.getValueByName("Owner"); Logger.log(value);
參數
名稱 | 類型 | 說明 |
---|---|---|
name | String | 以便取得 |
回攻員
String
:該欄的值
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://sites.google.com/feeds
setParent(parent)
setParent(parent)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
設定這個清單項目的上層頁面。
var page = SitesApp.getSite('example.com', 'mysite').getChildByName('mylistpage'); var secondListPage = SitesApp.getSite('example.com', 'mysite') .getChildByName('secondlistpage'); var items = page.getListItems(); // Returns secondListPage var parentPage = items[0].setParent(secondListPage).getParent();
參數
名稱 | 類型 | 說明 |
---|---|---|
parent |
| 新的父項 |
回攻員
— 用於鏈結的 ListItemListItem
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://sites.google.com/feeds
setValueByIndex(index, value)
setValueByIndex(index, value)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
針對編號欄設定這個 ListItem 的值,如果是網址欄,這個值必須為 XHTML 錨定標記,其中有 XML 實體逸出。
var page = SitesApp.getSite("example.com", "mysite").getChildByName("mylistpage"); var listItem = page.getListItems()[0]; listItem.setValueByIndex(1, 'This is the new value'); listItem.setValueByIndex(2, '<a href="http://www.example.com?a=1&b=2">Example</a>');
參數
名稱 | 類型 | 說明 |
---|---|---|
index | Integer | ,以便設定 |
value | String | 新值 |
回攻員
— 用於鏈結的 ListItemListItem
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://sites.google.com/feeds
setValueByName(name, value)
setValueByName(name, value)
已淘汰。此函式已淘汰,不應在新的指令碼中使用。
針對編號欄設定這個 ListItem 的值,如果是網址欄,這個值必須為 XHTML 錨定標記,其中有 XML 實體逸出。
var page = SitesApp.getSite("demositeappsscript").getChildByName("mylistpage"); var listItem = page.getListItems()[0]; listItem.setValueByName('Owner', 'Eric'); listItem.setValueByName('Page', '<a href="http://www.example.com?a=1&b=2">Example</a>');
參數
名稱 | 類型 | 說明 |
---|---|---|
name | String | ,以便設定 |
value | String | 新值 |
回攻員
— 用於鏈結的 ListItemListItem
授權
使用這個方法的指令碼必須取得以下一或多個範圍的授權:
-
https://sites.google.com/feeds