Bài đăng
Đang hiển thị bài đăng từ Tháng 5, 2016
HANDSOMEROOT
Display data from SharePoint Custom List to Web part using Javascript
- Nhận đường liên kết
- X
- Ứng dụng khác
Full code <script type="text/javascript" src="//ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"></script> <script type="text/javascript" src="_layouts/15/sp.runtime.js"></script> <script type="text/javascript" src="_layouts/15/sp.js"></script> <script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script> <script type="text/javascript"> $(function(){ GetProducts(); }); function GetProducts() { var clientContext = new SP.ClientContext.get_current(); var oList = clientContext.get_web().get_lists().getByTitle('Products'); this.collListItem = oList.getItems(""); clientContext.load(collListItem); clientContext.executeQueryAsync( Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed) ); } function onQuerySucceeded(sender, ...