How to work JQuery and content editor webpart functionality in sharepoint 2013?

Hi all,
I have a requirement to display the list data in share-point page by using JQuery and content editor web-part. could you please any one suggest the process to display the list data using JQuery and ContentEditorWebpart.
Thanks in advance.
Thanks,
phani kumar
Phani kumar

Hi,
From your description, my understanding is that you want to show a list data in a page using jQuery and Content Query Web Part.
You could use SharePoint REST API to accomplish your requirement, please refer to this code below:
<div id="listData">
</div>
<script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script><script type="text/javascript">
$(document).ready(function(){
//replace your list title
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('customlist03')/items",
type: "GET",
headers: {"accept": "application/json;odata=verbose"},
success: function (data) {
if (data.d.results) {
var obj = data.d.results;
for(var i = 0; i < obj.length; i++)
$("#listData").append("<div>title "+obj[i].Title+"</div>");
error: function (xhr) {
alert(xhr.status + ': ' + xhr.statusText);
</script>​​
The screenshot below is my result:
Please refer to these articles:
Working with lists and list items with REST
https://msdn.microsoft.com/en-us/library/office/dn292552.aspx
SharePoint 2013 – CRUD on List Items Using REST Services & jQuery
http://www.plusconsulting.com/blog/2013/05/crud-on-list-items-using-rest-services-jquery/
You can also get list data using JavaScript Client Object Model(JSOM), you could refer to this article:
How to: Complete basic operations using JavaScript library code in SharePoint 2013
https://msdn.microsoft.com/en-us/library/office/jj163201.aspx?f=255&MSPPError=-2147217396
Here is a link about how to add code into page via Content Editor Web Part:
http://blogs.msdn.com/b/sharepointdev/archive/2011/04/14/using-the-javascript-object-model-in-a-content-editor-web-part.aspx
Best Regards,
Vincent Han
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]

Similar Messages

  • How add the Video in Content Editor Webpart

    Hi All, 
    I have task to add the video in Content Editor Web-part.Can any one help me how can
    I add the video in Content Editor Web-part
    Samar

    Hi Samar,
    In addition to John’s suggestion, if you simply want to display a video file on a page, it is not necessary to use a Content Editor Web Part as a holder, in my opinion,
    Media Web Part would be a better choice for you.
    With the OOTB Media Web Part, there are more settings available which can help to manage video in a more comfortable way:
    https://support.office.com/en-ca/article/Add-video-or-audio-to-a-page-e5eff318-cd9d-4d77-bd79-1c282db23b46
    More information about Media Web Part:
    http://blogs.msdn.com/b/sanjaynarang/archive/2010/05/26/media-web-part-in-sharepoint-2010-faq.aspx
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • Installing and deploying a .webpart file in SharePoint 2013

    I have a webpart that took from a SharePoint 2010 web site from its webparts library. This webpart has the .webpart extension. I downloaded it as a copy. Now I want to install it to a SharePoint 2013 site ti its webpart gallery. I tried using Visual Studio
    by opening the .webpart file and copy its XML to the new empty .webpart source code. Also I uploaded the .webpart file to the Sharepoint 2013 WebPart Library. That also not successful. There was an error regarding when I insert the webpart to a page with a
    Correlation ID.
    The error is at the below.
    Unable to display this web part. To troubleshoot the problem, open this web page in a Microsoft SharePoint Foundation compatible HTML editor such as ...........................
    Correlation ID: cb3b839c-b011-e0f5-999c-31292d78623c
    Then how am I supposed to do this properly. I am new to Sharepoint.
    Could someone please help me to solve this matter?
    Thank you,
    Regards,
    Chiranthaka

    What web part is it?  Is it a custom / third party one?
    Also, more information on the .webpart structure might be handy -
    http://www.wictorwilen.se/Post/Web-Part-Properties-part-3-the-webpart-file.aspx
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • How to code a custom content search web part in Sharepoint 2013?

    Hi,
    Do you have any idea on how to create a custom Content Search Web part? What I mean is, I will code it in Visual Studio 2012.
    Regards,
    Napster

    check this
    http://social.technet.microsoft.com/Forums/ie/en-US/13f1e581-4250-48c7-93a6-ef7ae2bb14c5/is-this-there-a-way-to-programmatically-set-the-query-text-or-append-additional-kql-filtering-to-a?forum=sharepointsearch
    http://onlinecoder.blogspot.in/2013/08/sharepoint-2013-content-search-web-part.html

  • Script not working in SharePoint content editor webpart

    Hi All,
    <html>
    <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script language="javascript" type="text/javascript">
    $(document).ready(function () {
    //Call your function here like
    //retrieveListItems();
    ExecuteOrDelayUntilScriptLoaded(retrieveListItems, "SP.js");
    var siteUrl = '/vceo/PMO/EPMO/';
    var close1 = ''; var close2 = ''; var high = ''; var low = ''; var medium = ''; var lowMedium = ''; var mediumHigh = '';
    var open1 = ''; var open2 = ''; var high1 = ''; var low1 = ''; var medium1 = ''; var lowMedium1 = ''; var mediumHigh1 = '';
    var count = 0; var count1 = 0;
    var initiate = 0; var planning = 0; var execution = 0; var closing = 0;
    var sumMinimal = 0; var sumModerate = 0; var sumCritical = 0; var sumSevere = 0;
    var sumHighlyLikely = 0; var sumLikely = 0; var sumSomewhat = 0; var sumUnlikely = 0;
    var sumBudget = 0; var sumCommitted = 0; var sumConsumption = 0;
    function retrieveListItems() {
    alert("Welcome to Dashboard");
    var clientContext = new SP.ClientContext(siteUrl); alert("site url");
    var oList = clientContext.get_web().get_lists().getByTitle('Project Issues and Risks');
    var oList1 = clientContext.get_web().get_lists().getByTitle('Project');
    var oList2 = clientContext.get_web().get_lists().getByTitle('Risk Impact');
    var oList3 = clientContext.get_web().get_lists().getByTitle('Risk Probability'); alert("get by title");
    var camlQuery = new SP.CamlQuery(); var camlQuery1 = new SP.CamlQuery(); var camlQuery2 = new SP.CamlQuery(); var camlQuery3 = new SP.CamlQuery(); var camlQuery4 = new SP.CamlQuery(); var camlQuery5 = new SP.CamlQuery(); var camlQuery6 = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Project_x0020_Issue_x0020_Status" /><Value Type="Choice">Issue</Value></Eq></Where></Query></View>');
    camlQuery1.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Project_x0020_Issue_x0020_Status" /><Value Type="Choice">Risk</Value></Eq></Where></Query></View>');
    camlQuery2.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Overall_x0020_Status" /><Value Type="Choice">Open</Value></Eq></Where></Query></View>');
    camlQuery3.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Overall_x0020_Status" /><Value Type="Choice">Closed</Value></Eq></Where></Query></View>');
    camlQuery4.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    camlQuery5.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    camlQuery6.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    this.collListItem = oList.getItems(camlQuery); this.collListItem1 = oList.getItems(camlQuery1); this.collListItem2 = oList1.getItems(camlQuery2); this.collListItem3 = oList1.getItems(camlQuery3);
    this.collListItem4 = oList2.getItems(camlQuery4); this.collListItem5 = oList3.getItems(camlQuery5); this.collListItem6 = oList1.getItems(camlQuery6);
    clientContext.load(collListItem); clientContext.load(collListItem1); clientContext.load(collListItem2); clientContext.load(collListItem3); clientContext.load(collListItem4); clientContext.load(collListItem5); clientContext.load(collListItem6);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    alert("retrieve list");
    function onQuerySucceeded(sender, args) {
    alert("succeed");
    var listItemEnumerator = collListItem.getEnumerator(); var listItemEnumerator1 = collListItem1.getEnumerator(); var listItemEnumerator2 = collListItem2.getEnumerator();
    var listItemEnumerator3 = collListItem3.getEnumerator(); var listItemEnumerator4 = collListItem4.getEnumerator(); var listItemEnumerator5 = collListItem5.getEnumerator(); var listItemEnumerator6 = collListItem6.getEnumerator();
    var sumClose = 0; var sumClose1 = 0; var sumHigh = 0; var sumMedium = 0; var sumLow = 0; var sumLowMedium = 0; var sumMediumHigh = 0;
    var sumOpen = 0; var sumOpen1 = 0; var sumHigh1 = 0; var sumMedium1 = 0; var sumLow1 = 0; var sumLowMedium1 = 0; var sumMediumHigh1 = 0;
    while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); sumClose += oListItem.get_item('Close'); sumOpen += oListItem.get_item('Open'); sumHigh += oListItem.get_item('High'); sumMedium += oListItem.get_item('Medium'); sumLow += oListItem.get_item('Low'); sumLowMedium += oListItem.get_item('LowMedium'); sumMediumHigh += oListItem.get_item('MediumHigh'); }
    while (listItemEnumerator1.moveNext()) { var oListItem1 = listItemEnumerator1.get_current(); sumClose1 += oListItem1.get_item('Close'); sumOpen1 += oListItem1.get_item('Open'); sumHigh1 += oListItem1.get_item('High'); sumMedium1 += oListItem1.get_item('Medium'); sumLow1 += oListItem1.get_item('Low'); sumLowMedium1 += oListItem1.get_item('LowMedium'); sumMediumHigh1 += oListItem1.get_item('MediumHigh'); }
    while (listItemEnumerator4.moveNext()) { var oListItem4 = listItemEnumerator4.get_current(); sumMinimal += oListItem4.get_item('Minimal'); sumModerate += oListItem4.get_item('Moderate'); sumSevere += oListItem4.get_item('Severe'); sumCritical += oListItem4.get_item('Critical'); }
    while (listItemEnumerator5.moveNext()) { var oListItem5 = listItemEnumerator5.get_current(); sumUnlikely += oListItem5.get_item('Unlikely'); sumSomewhat += oListItem5.get_item('Somewhat'); sumLikely += oListItem5.get_item('Likely'); sumHighlyLikely += oListItem5.get_item('HighlyLikely'); }
    while (listItemEnumerator6.moveNext()) { var oListItem6 = listItemEnumerator6.get_current(); sumBudget += oListItem6.get_item('Project_x0020_Budget_x0020_Amoun'); sumCommitted += oListItem6.get_item('Committed_x0020_Budget'); }
    count = this.collListItem2.get_count();
    count1 = this.collListItem3.get_count();
    while (listItemEnumerator2.moveNext()) {
    var oListItem2 = listItemEnumerator2.get_current();
    var stat = oListItem2.get_item('Project_x0020_Status');
    if (stat == "Intiation") {
    initiate = initiate + 1
    if (stat == "Planning") {
    planning = planning + 1
    if (stat == "Execution") {
    execution = execution + 1
    if (stat == "Closing") {
    closing = closing + 1
    //alert("initiate" + initiate); alert("planning" + planning); alert("execution" + execution); alert("closing" + closing);
    //alert("countOpen" + count); alert("closed:" + count1);
    window.close1 = sumClose; window.close2 = sumClose1; window.high = sumHigh; window.low = sumLow; window.medium = sumMedium; window.mediumHigh = sumMediumHigh; window.lowMedium = sumLowMedium;
    window.open1 = sumOpen; window.open2 = sumOpen1; window.high1 = sumHigh1; window.low1 = sumLow1; window.medium1 = sumMedium1; window.mediumHigh1 = sumMediumHigh1; window.lowMedium1 = sumLowMedium1;
    drawChart();
    function onQueryFailed(sender, args) { alert('Request failed.. ' + args.get_message() + '\n' + args.get_stackTrace()); }
    google.load("visualization", "1", { packages: ["corechart"] });
    function drawChart() {
    var data = google.visualization.arrayToDataTable([['Task', 'Issues'], ['Close', window.close1], ['Open', window.open1]]);
    var data1 = google.visualization.arrayToDataTable([['Task', 'Risks'], ['Close', window.close2], ['Open', window.open2]]);
    var data2 = google.visualization.arrayToDataTable([['Program', 'High', 'Medium-High', 'Medium', 'Low-Medium', 'Low'], ['Category', window.high, window.mediumHigh, window.medium, window.lowMedium, window.low]]);
    var data3 = google.visualization.arrayToDataTable([['Program', 'High', 'Medium-High', 'Medium', 'Low-Medium', 'Low'], ['Category', window.high1, window.mediumHigh1, window.medium1, window.lowMedium1, window.low1]]);
    var data4 = google.visualization.arrayToDataTable([['Project', 'Status'], ['Closed', count1], ['Open', count]]);
    var data5 = google.visualization.arrayToDataTable([['Project', 'Status'], ['Initiation', initiate], ['Planning', planning], ['Execution', execution], ['Closing', closing]]);
    var data6 = google.visualization.arrayToDataTable([['Program', 'Impact'], ['Minimal', sumMinimal], ['Moderate', sumModerate], ['Severe', sumSevere], ['Critical', sumCritical]]);
    var data7 = google.visualization.arrayToDataTable([['Program', 'Probability'], ['Highly Likely/Probable(76%-100%)', sumHighlyLikely], ['Likely(51%-76%)', sumLikely], ['Somewhat Likely(26%-50%)', sumSomewhat], ['Unlikely/Improbable(0%-25%)', sumUnlikely]]);
    var data8 = google.visualization.arrayToDataTable([['Project', 'Budget'], ['Approved', sumBudget], ['Committed', sumCommitted]]);
    var options = { title: 'Program Issues', width: 200, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options1 = { title: 'Program Risks', width: 200, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options2 = { width: 200, height: 200, legend: { position: 'top', maxLines: 3 }, bar: { groupWidth: '25%' }, isStacked: true, vAxis: { title: 'Open', titleTextStyle: { color: 'red' } } };
    var options3 = { width: 200, height: 200, legend: { position: 'top', maxLines: 3 }, bar: { groupWidth: '25%' }, isStacked: true, vAxis: { title: 'Open', titleTextStyle: { color: 'red' } } };
    var options4 = { title: 'Project Status', width: 225, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options5 = { width: 175, height: 200, legend: { position: 'top', maxLines: 10 }, pieSliceText: 'value', };
    var options6 = { title: 'Program Risk Impact', width: 300, height: 300, legend: 'right', pieSliceText: 'value', };
    var options7 = { title: 'Program Risk Probable', width: 300, height: 300, legend: 'right', pieSliceText: 'value', };
    var options8 = { title: 'Project Budget', width: 300, height: 300, legend: 'bottom', pieSliceText: 'value', };
    var chart = new google.visualization.PieChart(document.getElementById('chart_div3'));
    chart.draw(data, options);
    var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));
    chart1.draw(data1, options1);
    var chart2 = new google.visualization.ColumnChart(document.getElementById('chart_div1'));
    chart2.draw(data2, options2);
    var chart3 = new google.visualization.ColumnChart(document.getElementById('chart_div2'));
    chart3.draw(data3, options3);
    var chart4 = new google.visualization.PieChart(document.getElementById('chart_div4'));
    chart4.draw(data4, options4);
    var chart5 = new google.visualization.PieChart(document.getElementById('chart_div5'));
    chart5.draw(data5, options5);
    var chart6 = new google.visualization.PieChart(document.getElementById('chart_div6'));
    chart6.draw(data6, options6);
    var chart7 = new google.visualization.PieChart(document.getElementById('chart_div7'));
    chart7.draw(data7, options7);
    var chart8 = new google.visualization.ColumnChart(document.getElementById('chart_div8'));
    chart8.draw(data8, options8);
    </script>
    </head>
    <body>
    <table >
    <tbody>
    <tr>
    <td id="chart_div8" colspan="2" style="border-bottom:ridge;border-left:ridge;border-top:ridge"></td>
    <td id="chart_div4" style="border-bottom:ridge;border-left:ridge;border-top:ridge"></td>
    <td id="chart_div5" style="border-bottom:ridge;border-right:ridge;border-top:ridge"></td>
    </tr>
    <tr>
    <td id="chart_div" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div2" style="border-bottom:ridge;"></td>
    <td id="chart_div3" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div1" style="border-bottom:ridge;border-right:ridge""></td>
    </tr>
    <tr>
    <td id="chart_div6" colspan="2" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div7" colspan="2" style="border-bottom:ridge;border-left:ridge;border-right:ridge"></td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>
    This content editor webpart not working in sharepoint page. Once I checked out to the page then chart is working. When i checkedin function not get called. How to fix this?
    THanks in advance!

    In SharePoint 2013, sp.js and sp.runtime.js does not load on the page in published mode. You need to explicitly load these files. You can check using IE developer tools in the Script section that in published mode these files are missing.
    In order to fix this issue explictly refer these two js files on your page.
    <script type="text/javascript" src="_layouts/15/sp.runtime.js"></script>
    <script type="text/javascript" src="_layouts/15/sp.js"></script>
    Geetanjali Arora | My blogs |

  • How to Add Content Editor WebPart in PageLayout

    Hi
    I have copied the Content Editor webpart snippet and pasted it in my Page layout.
    But nothing is showing in page edit mode. 
    Can anyone tell me how to add this if the following is not correct?
    <div style="width:100%">
                    <div data-name="WebPartZone">
                        <!--CS: Start Content Editor Snippet--><!--SPM:<%@Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint,
    Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>--><!--MS:<WebPartPages:ContentEditorWebPart xmlns:WebPartPages="namespace" runat="server" webpart="true">--><!--PS: Start of READ-ONLY
    PREVIEW (do not modify)--><div class="ms-webpart-chrome ms-webpart-chrome-fullWidth "><div class="ms-webpart-chrome-title" id="WebPart_ChromeTitle"><span title="$Resources:core,ContentEditorWebPartTitle;
    - $Resources:core,ContentEditorWebPartDescription;" id="WebPartTitle" class="js-webpart-titleCell"><h2 style="text-align:justify;" class="ms-webpart-titleText"><nobr><span>$Resources:core,ContentEditorWebPartTitle;</span><span
    id="WebPartCaption"></span></nobr></h2></span></div><div WebPartID="00000000-0000-0000-0000-000000000000" HasPers="true" id="WebPart" width="100%" class="ms-WPBody ms-WPBorder
    noindex ms-wpContentDivSpace " OnlyForMePart="true" allowDelete="false" style=""><div class="ms-rtestate-field"></div><div class="ms-clear"></div></div></div><!--PE:
    End of READ-ONLY PREVIEW--><!--MS:<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">--><!--MS:<Title>--><!--SPM:$Resources:core,ContentEditorWebPartTitle;--><!--ME:</Title>--><!--MS:<Description>--><!--SPM:$Resources:core,ContentEditorWebPartDescription;--><!--ME:</Description>--><!--MS:<PartImageLarge>--><!--SPM:/_layouts/15/images/mscontl.gif--><!--ME:</PartImageLarge>--><!--MS:<ID>--><!--SPM:g_4998626c_cd3f_4f31_962c_51e943923c4f--><!--ME:</ID>--><!--ME:</WebPart>--><!--ME:</WebPartPages:ContentEditorWebPart>--><!--CE:
    End Content Editor Snippet-->
                    </div>
                </div>
    S H A J A N

    Hi  ,
    For adding the Content Editor Web Part to a SharePoint Layout , you can add the  code between the <Zonetemplate> tags:
    <!-- CEWP -->
    <WebPartPages:ContentEditorWebPart ID="ContentEditorWebPart1" runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{F40E10C3-ED3A-473D-8538-996344EE795C}" >
    <WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
    <Title>Content Editor Web Part</Title>
    <FrameType>TitleBarOnly</FrameType>
    <Description>Use for formatted text, tables, and images.</Description>
    <IsIncluded>true</IsIncluded>
    <PartOrder>2</PartOrder>
    <FrameState>Normal</FrameState>
    <Height />
    <Width />
    <AllowRemove>true</AllowRemove>
    <AllowZoneChange>true</AllowZoneChange>
    <AllowMinimize>true</AllowMinimize>
    <AllowConnect>true</AllowConnect>
    <AllowEdit>true</AllowEdit>
    <AllowHide>true</AllowHide>
    <IsVisible>true</IsVisible>
    <DetailLink />
    <HelpLink />
    <HelpMode>Modeless</HelpMode>
    <Dir>Default</Dir>
    <PartImageSmall />
    <MissingAssembly>Cannot import this Web Part.</MissingAssembly>
    <PartImageLarge>/_layouts/images/mscontl.gif</PartImageLarge>
    <IsIncludedFilter />
    <ExportControlledProperties>true</ExportControlledProperties>
    <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
    <ID>g_f40e10c3_ed3a_473d_8538_996344ee795c</ID>
    <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
    <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"><![CDATA[Edit this text.]]></Content>
    <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
    </WebPart>
    </WebPartPages:ContentEditorWebPart>
    For more information, you can refer to the thread:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/1ba645f2-2481-4560-a4c3-3be9f9e878bc/adding-the-content-editor-web-part-to-a-sharepoint-layout-aspx-page?forum=sharepointcustomizationlegacy
    http://hiren-j-patel.blogspot.com/2012/07/hello-all-today-we-will-add-content.html
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to download aspx page with Content Editor Webpart

    Hi All
    I have lots of aspx pages (with CEWP) in my Sitepages library. I have to replace some RegEx from all pages.
    When I am downloading those pages from Sitepages using 'open in explorer', actual content of page is not coming up i.e. CEWP and its HTML code is missisng.
    Is there anyway, can I download those page with content or is there powershell script using which I can remove those regular expression from sitepages library itself.

    Hi,
    If you want to modify the content in the Content Editor Web Part in all pages in a batch, a solution is that you can loop through all the site pages and read/write the content
    of the specific Content Editor Web Part using SharePoint Object Model.
    ContentEditorWebPart.Content property will help to get or set embedded
    HTML that provides content for this Web Part:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.contenteditorwebpart.content.aspx
    WebPartManager.WebParts Property can get a reference to all WebPart controls
    tracked by the WebPartManager control on a Web page:
    http://msdn.microsoft.com/EN-US/library/h8dcy47h
    Two code demos in the threads below:
    http://stackoverflow.com/questions/1522046/retrieve-a-list-of-web-parts-on-a-page
    http://stackoverflow.com/questions/633633/sharepoint-how-can-i-find-all-the-pages-that-host-a-particular-web-part
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to center a content editor webpart on a page

    I've a content editor webpart with a linked js that display a searchbox. I'd like center my webpart in the page
    Here is the html in my js file
    <div style="display:table; margin:0 auto;width:100%">
        <div style="float:left">
            <input type="text" id="tbSearch" name="tbSearch" class="ms-sbplain" style="width: 368px;" onkeydown="if (event.keyCode == 13){launchSearch();return false;}">
        </div>
        <div style="float:left;border-width: 1px; border-style: solid; border-color: #c3c3c3; border-left-width:0 ">
            <img  onClick="launchSearch();return false;" title="Search" class="srch-gosearchimg" onmouseover="this.src='\u002f_layouts\u002fimages\u002fgosearchhover30.png'" onmouseout="this.src='\u002f_layouts\u002fimages\u002fgosearch30.png'"
    alt="Search" src="/_layouts/images/gosearch30.png"/>
        </div>                                  
    </div>

    You could wrap the contents of your content editor web part in a div and apply styling/attributes
    to the div to center it on the page.
    as 
    You should be able to get the ID of the Search Web Part and then use the align center code.
    align="center"

  • Content editor webpart- unable to see the list data if given the url in the content link?

    HI,
    In content editor webpart,unable to see the list data
    when try to give the list url in the content link?
    please help on the above issue.
    and also want to see the styles to the list.
    how to add the styles to the list row by row.

    Hi sudhir,
    If you click the ellipsis beside the content link, it will pop up a window for you to input the file link. No list option will be offered to be chose.
    When I add a content editor web part to a list, I usually save the code into a Notepad file and save it to a document library. Then copy the url of the document and then paste it into content link.
    Also, you could click Edit HTML Source, then directly add code into the popup window. It works as the same as the above method.
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Content editor webpart error "cannot retrieve properties at this time"

    Hi,
    Everytime I try to editor content within the content editor web part I receive the error message "cannot retrieve properties at this time".
    I can edit the content within the web part when I use http. The error only seems to occur to when using https and SSL.
    I've looked at the following web site and KB articles to implement a workaround however still get the same error.
    http://support.microsoft.com/default.aspx/kb/912060
    http://www.sharepointblogs.com/agoodwin/archive/2007/09/03/content-editor-webpart-error-quot-cannot-retrieve-properties-at-this-time-quot.aspx
    http://support.microsoft.com/kb/830342
    Can anyone else suggest anything else?

    My symptoms
    1.  CEWP & Sharepoint Designer could not retrieve data.
    2.  Event id 5000 "ulsexception12,p1 w3wp.exe ..."
    Problem
    1. Upgraded Small Farm WSS and SPS 2007 to SP2.
    2. Unhandled exceptions and access denieds int the uls logs no specifics to run down.
    3. Crawl issues and had to reset the crawl index.
    Solution
    1. ASPNet user account had certain rights stripped by gpo, check your permission with Tech Net "IIS and Built-in Accounts 6.0"  or I found a much easier product to use Mircrosofts "Authentication & Access Control Diagnostics 1.0"
    2. Ran the "stsadm -o sync -listolddatabases 0" to check for unsyn'd databases  then ran the "stsadm -o sync deleteolddatabases 0"  to clear those databases.
    Havn't seen any further issues, this was a tuff nut to crack hope this helps someone else.jellywood

  • How to work even and odd number query

    Plz explain how below worked even and odd query
    2 ) why used subquery after from and which time we can use(what time of out put)
    even
    select * FROM (SELECT ROW_NUMBER() OVER(ORDER BY stud_id) as row ,grno,stud_id from stud_Enrollment) d
     WHERE d.row %2=0   
    odd
    select * FROM (SELECT ROW_NUMBER() OVER(ORDER BY stud_id) as row ,grno,stud_id from stud_Enrollment) d
     WHERE d.row %2=1

    Row_Number function returns the sequential number of a row
    (By using partition of a result set, starting at 1 for the first row in each partition)
    >> why used subquery after from and which time we can use(what time of out put)
    When we need sequntial numbers, we can use row_number function. Put it into derived table and use this derived table after FROM clause (Same way it is used in your query)
    CREATE TABLE stud_Enrollment (
    grno int,
    stud_id int,
    stud_name varchar(20)
    INSERT INTO stud_Enrollment
    VALUES (101, 511, 'Dheeraj'), (112, 521, 'Vaibhav'), (132, 522, 'Lalit'), (124, 564, 'Amogh'), (143, 598, 'Sushrut')
    SELECT * FROM stud_Enrollment
    -- Result of your table
    --grno stud_id stud_name
    --101 511 Dheeraj
    --112 521 Vaibhav
    --132 522 Lalit
    --124 564 Amogh
    --143 598 Sushrut
    -- Now we need to find out the rows which are at even position, ie row should be at position of 0,2,4,6,8 etc..
    -- But we don't have sequential number here in your table result
    -- So we can create one new column by using row_number function
    SELECT
    ROW_NUMBER() OVER (ORDER BY stud_id) AS row, --> additiona "row" column
    grno,
    stud_id,
    stud_name
    FROM stud_Enrollment
    -- We got "row" column in below output
    --row grno stud_id stud_name
    --1 101 511 Dheeraj
    --2 112 521 Vaibhav
    --3 132 522 Lalit
    --4 124 564 Amogh
    --5 143 598 Sushrut
    -- Now above table is used after FROM clause. It uses row column in WHERE part
    SELECT
    FROM (SELECT
    ROW_NUMBER() OVER (ORDER BY stud_id) AS row,
    grno,
    stud_id,
    stud_name
    FROM stud_Enrollment) d
    WHERE d.row % 2 = 0
    --row grno stud_id stud_name
    --2 112 521 Vaibhav
    --4 124 564 Amogh
    -Vaibhav Chaudhari

  • How to drop datafiles and contents

    how to drop datafiles and contents without dropping tablespace?

    May be this helps,
    http://www.mydigitallife.info/2007/08/04/how-to-rename-or-move-oracle-tablespace-datafile-to-another-location/

  • How to hide the Columns and Views for Login user in SharePoint 2013

    Hi Friends,
    How to hide the Columns and Views for Login user in SharePoint 2013? Is it possible using OOB features? If not possible how can we hide the Columns and Views for Login user?
    Could you please help on this.
    Thanks,
    Tiru
    Tiru

    Hello Tirupal,
    There is no OOB way to do this.
    Please check this codeplex solution to achieve the same.
    https://sp2013columnpermission.codeplex.com/
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • How to find dismantled and reinstalled equipments of functional location?

    Dear Experts,
    how to find dismattled and reinstalled equipments of functional location. if any equipment is dismanttled and not reinstalled, for those want to display in ALV report? how?
    regards,
    venkey

    venky,
    Suppose a particular equipment had undergone several dismantlings under various Functional location/Equipments and presently it is not installed anywhere.
    Such equipments can be searched through AVLB system status in IH08.
    Go to the Master data of any such equipment and in the Menubar Extras-->Usagelist will give you the information you wanted in ALV format.
    Regards...

  • Update Column value after current item is Approved and then publish major version using Sharepoint 2013 designer workflow

    Hi,
    We have a requirement to update a column value once the item has been approved.
    Following settings have been made in the publishing articles list:
    Require content approval for submitted items : yes
    Create major and minor (draft) versions
    Who should see draft items in this document library? :Only users who can edit items
    Require documents to be checked out before they can be edited? : yes
    I have createdatu a Sharepoint 2013 workflow to check if Approval sts of current item = 0 i.e. Approved , then check out and update the item and finally checkin the item. Everything works fine till this point except that the minor version of the item is
    checked in. Due to this the updated columns are not published to others.
    Also, I created a Sharepoint 2010 workflow to SET CONTENT APPROVAL = APPROVED and started this workflow from my list workflow above, but the item does not get checked-in and always shows "In Progress" status with comment "The item is currently
    locked for editing. Waiting for item to be checked in or for the lock to be released.".
    Please let me know where I am missing out so that once the item is approved, column value gets updated and current item is still in Approved status.
    Thanks

    Hi,
    According to your post, my understanding is that you want to update Column value after current item is Approved and then publish major version using Sharepoint 2013 designer workflow.
    You will get into this kind of Catch-22 situation trying to set the Content Approval Status in SharePoint Designer workflow:
    - You must check out the document before you can change the Content Approval Status
             - You can't change the Content Approval Status once the document in checked out
    Since you set the Require documents to be checked out before they can be edited=Yes, you will need to check out the document when run the workflow on the item. But you cannot approve a document when it is checked
    out. So the logic in workflow conflicts.
    As a workaround, you can use the Start Another Workflow action to start the normal Approval workflow on the document.  The built-in Approval workflow can work with a document that’s not checked out.
    The designer approval workflow also can work with a document that’s not checked out.
    You can create two workflow using SharePoint Designer 2013.
    First, create a SharePoint 2010 platform workflow.
    Then, create a SharePoint 2013 platform workflow.
    Then when the SharePoint 2013 platform workflow start, it will start the SharePoint 2010 platform workflow to set content approval status, then the SharePoint 2013 platform workflow will update current item value.
    More information:
    SharePoint Designer Workflow Content Approval Issue
    SharePoint 2010 Approval Workflow with Content Approval
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

Maybe you are looking for

  • Why is Adobe Reader X deleting my PDF files when I try to burn to CD?

    I am using Adobe Reader X 10.0.1.  Within Windows Explorer I mark a pdf file for burning, then click burn at the top of the page.  Adobe tells me the file is missing.  Then when I check for the file, it is gone!  And not in the recycle bin either.  I

  • How can i update my 4th generation

    hello can someone tell me how to update my 4th generation ipod touch? i hope someone can help me. i cant afford to pay $59.00 to update it. thank you.

  • Print A1 on multiple A3 sheets.

    I'm trying to print an A1 document on multiple A3 sheets. I have Acrobat Professional 10.1.3 on a mac. I have tried downloading pdf mate and other free programmes but nothing working as I am on a mac. I have the Adobe CS5.5 Master collection so have

  • HP 4700dn Printing Blank Pages

    iMAC running OS X 10.9.2 Printing Blank pages with one saying "%! PS- Adobe - 3.0 %APL_DSC_Encoding: UTF8 %APLProducer: (Version 10.9.2 (Build 13C102"

  • Why is there no option to change snooze in apple clock devices?

    Why doesn't apple provide an option to change the snooze time on their devices?? I find this really stupid, it's one of the most obivious thing to add in an alarm clock. Yet that option isn't there! Why??!! Isn't iPhone meant to be the smartest phone