Menu
  • HOME
  • TAGS

jquery in sharepoint 2013 web part [closed]

jquery,sharepoint,sharepoint-2013,web-parts,ascx

You might want to put your jQuery files in a specific folder in Layouts as to not clutter the Layouts directory. And then you can simply reference your jQuery files like this: <SharePoint:Scriptlink ID="jQuery" runat="server" Name="MyWebPart/jquery-2.1.0.min.js" Language="javascript" /> <SharePoint:Scriptlink ID="jQueryUI" runat="server" Name="MyWebPart/jquery-ui-1.10.4.min.js" Language="javascript" /> And so your files would be...

Sharepoint “edit page” keeps loading due to certain webpart

asp.net,sharepoint,web-parts

OK,I find the reason. Since my webpart has an textbox validator and by default the textbox is hidden, when I click "edit page", the validator will be fired and prevent the editing. I put the following code in my page_load JavaScript and the issue is solved. $(function () { var...

Why is this jQuery not working on my Sharepoint page?

jquery,html,checkbox,sharepoint-2010,web-parts

It usually happens when you created elements dynamically. Try this: $(document).on("change", '#ckbxEmp', function () { if ($(this).prop("checked")) { alert("Checked"); } else { alert("Not checked"); } }); Take a look on Direct and delegated events UPDATE: Full code: <script> $(document).on("change", '#ckbxEmp', function () { console.log('Function has been reached'); if ($(this).is(":checked")) {...

Why does my Sharepoint WebPart deploy (nominally), but is still not available for adding to a page/form?

sharepoint,sharepoint-2010,web-parts,webpartpage

By comparing a working project with this one, I was finally able to get it to deploy without the "A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe." add-time error msg....

How can I respond to a RadioButton's change event with jQuery on a SharePoint WebPart?

jquery,sharepoint-2010,web-parts,document-ready

The problem was that trying to get a reference to the element using the ID I gave it was not good enough, as Sharepoint, or ASP.NET, or Chrome, or Tim Berners-Lee, or Al Gore, or somebody, was Welshifying the ID, as seen in "View Source" And so, I had to...

Custom Properties on a SP2013 Sandboxed visual web part

c#,sharepoint-2013,web-parts,sandbox

Seems like you are going overboard with the custom editor. If you simply need those two web part properties than you don't need to create the custom editor. Your files can simply look like this: ChargeWebPart.ascx: <div> <table style="width:100%; border: 1px solid black;"> <tr> <td> <h3 style="text-align:center">Charge Calculator</h3> </td> </tr>...

SPSite - Access to Site Records from another Farm

sharepoint,web-parts

You cannot access site from another farm using Server Object Model. To be able to access site using Server Object Model you need to run it locally on server. Try to use any of the remote endpoints (REST or Client Object Model). You can find full list here....

SharePoint custom web part jQuery is “undefined”

jquery,sharepoint-2010,migration,sharepoint-2013,web-parts

You can create a visual webpart and add all js file which you need with the this code protected void Page_Load(object sender, EventArgs e) { Type csType = this.GetType(); ClientScriptManager cs = Page.ClientScript; String jQueryURL0 = path+ "_layouts/15/jquery/js/jquery-1.9.1.min.js"; if (!cs.IsClientScriptIncludeRegistered(csType, "jquery.js")) { cs.RegisterClientScriptInclude(csType, "jquery.js", jQueryURL0); } } and add jquery...

Sharepoint 2010 Excel Web Part displaying Pivot Table colors incorrectly

excel,sharepoint-2010,web-parts,pivot-table

We were able to resolve the problem by restarting the Excel Services component of Sharepoint 2010.

Why is this jQuery running — but not working — on my page, although it works in jsfiddle?

jquery,web-parts,document-ready,ascx,onkeyup

It's because your function runs AFTER you pressed the key. So that way it won't prevent you from pressing and inputting that key. The JSFiddle you referenced does it before. So change your function to be : $(document).on("keypress", '[id$=txtbxSSNOrITIN]', function (e) { // ^^^^^^^^keypress instead of keyup alert('the textbox keyup...

How can I reduce the width of an HtmlTableCell or otherwise join together two controls in an HtmlTableRow?

c#,html,asp.net,sharepoint-2010,web-parts

HtmlTableCell seems to have a ColSpan property. You may try setting that on the other rows to format it the way you would like: https://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmltablecell.colspan(v=vs.110).aspx...

How can I reduce the amount of vertical space between lines of text using CSS?

css,sharepoint-2010,web-parts

Line height is not the problem here. The problem is the space between the elements, which is controlled by the margin properties. These tend to be preset to some values that allow for "normal" text flow, so you will have space before and after a heading and around paragraphs for...

Update Panel posts back after a period of inactivity

asp.net,ajax,telerik,sharepoint-2013,web-parts

It looks like it is a known bug in SharePoint 2013. People suggested to install December 2014 CU to solve it, but it did not solve it. Someone mentioned in this link to make request to server via javascript event given interval. As my page does postback if I leave...

Why is OnPreRender being called over and over again?

asp.net,sharepoint-2010,web-parts,pageload,webpartpage

The solution was to move the code that was in OnPreRender() to Page_Load() Apparently, just like at the stockyard, rendering happens many times, while the page is only loaded once. That's my theory, and I'm stickin' to it (for now, anyway)....

How to get a reference to custom settings in webpart from a page within webpart?

sharepoint,sharepoint-2010,web-parts

You can access the Web part properties using the SPLimitedWebPartManager class by reading the web part collection and their properties on the page as shown below, var web = SPContext.Current.Web; var currentPageURL = "//URL of the page on which the Web part is present"; var page = web.GetFile(currentPageURL); using (SPLimitedWebPartManager...

How can I add jQuery to a WebPart (to respond to certain events on the WebPart)?

c#,jquery,sharepoint-2010,web-parts

The thing to do (or perhaps I should write, "a" thing to do) to get this to work is to add code like the following to the end of the WebPart's *.ascx file: <script> $(document).ready(function () { alert("The ready function has been reached"); }); $(document).on("change", '[id$=ckbxEmp]', function () { alert('Function...

SharePoint 2013 - display the detail from a list item in a branded page, NOT the default SharePoint details page

html,sharepoint,sharepoint-2013,web-parts,branding

For your use case, the REST API would probably be simplest & still meet your needs. You can fire a simple GET request for the item details then display it however you wish in accordance with your custom UI. Be it loading a custom form page you build or even...

SharePoint 2013 How to use Web Part Connections? (Visual Web Part)

sharepoint,web-parts

Ok so I found what I was looking for partialy, below is the code that captures the Connection object private IWebPartField _provider = null; [ConnectionConsumer("Parameter", AllowsMultipleConnections = false)] public void ThisNameDoesNotMatter(IWebPartField provider) { _provider = provider ; } the IWebPartField Interface was what I was looking for to consume a...

Can I create javascript in SP web part to post to Yammer group, not in an app?

web-parts,yammer

In order to interact with the Yammer API, you need to create an app in Yammer. It's a very simple process and the purpose is to secure an ID and secret so that you can authenticate against the Yammer API. It's not an app in the SharePoint sense (or O365)....

Can REST-like URLs be passed/recognized in sharepoint 2010?

c#,rest,sharepoint-2010,web-parts,dynamic-usercontrols

Perhaps kludgy, but maybe the way to do this would be to set a global variable on leaving the page that can be read from the next page. Something like (pseudocode): enum FormFactors { Vanilla, Chocolate, Asparagus, Mantequilla de Cacahuate, Pineapple } FormFactors ff = null; . . . if...