This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| that.getData = function (listName, xmlQuery, contentType, onGetSuccess) { | |
| var objClientCtx = new SP.ClientContext.get_current(); | |
| if (objClientCtx) { | |
| var oWeb = objClientCtx.get_web(); | |
| var oList = oWeb.get_lists().getByTitle(listName); | |
| var query = new SP.CamlQuery(); | |
| query.set_viewXml(xmlQuery); | |
| var objlistItems = oList.getItems(query); | |
| objClientCtx.load(objlistItems); | |
| objClientCtx.executeQueryAsync(function (sender, args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var oWeb = objClientCtx.get_web(); | |
| var oList = oWeb.get_lists().getByTitle(listName); | |
| var query = new SP.CamlQuery(); | |
| query.set_viewXml(xmlQuery); | |
| var objlistItems = oList.getItems(query); | |
| objClientCtx.load(objlistItems); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| objClientCtx.executeQueryAsync(function (sender, args) { | |
| that.DataSet = []; | |
| var objlistEnumerator = objlistItems.getEnumerator(); | |
| while (objlistEnumerator.moveNext()) { | |
| var objListItem = objlistEnumerator.get_current(); | |
| var id = objListItem.get_item('ID'); | |
| var filePath = 'Path to current list/ListName/'+id+'_.000' | |
| var web = objClientCtx.get_web(); | |
| var listItemInfo = web.getFileByServerRelativeUrl(filePath) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| objClientCtx.executeQueryAsync( | |
| function (sender, args) { | |
| var fileVersions = listItemInfo.get_versions(); | |
| objClientCtx.load(fileVersions); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var objlistVersionEnumerator = fileVersions.getEnumerator(); | |
| while (objlistVersionEnumerator.moveNext()) { | |
| var objCurrentListItemVersion = objlistVersionEnumerator.get_current(); | |
| conso9le.log(objCurrentListItemVersion.get_url()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _vti_history/512/Lists/List Name/265_.000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var $div = $('<div>'); | |
| $div.load('Site collection path/Lists/ListName/DispForm.aspx?ID=265&VersionNo=1024 table.ms-formtable', function(){ | |
| var table = $(this).find('table.ms-formtable'); | |
| var tr = $(table).find('tr'); | |
| $(tr).each(function(){ | |
| var row = $(this); | |
| var columnName = $.trim(row.find('td:eq(0)').text()); | |
| var columnValue = $.trim(row.find('td:eq(1)').text()); | |
| console.log(columnName); | |
| console.log(columnValue); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| that.GetSharePointListData = function (listName, camlQuery, onGetSuccess) { | |
| SP.SOD.executeFunc("sp.js", 'SP.ClientContext', function () { | |
| that._getData(listName, camlQuery, onGetSuccess); | |
| }); | |
| } |
OlderNewer