Unable to apply color formatting to document library custom view using javascript
Hello,
I have applied color formatting to some values in Document library at "Allitems.aspx" page.
Created one view where record of library displaying as per sort rule and trying to apply the color formatting on that view, but its not getting apply.
also tried to insert that list as web part in one page with the same view(created by me) and tried applying color..but not working.
I used below script for color formatting, included in script editor web part:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
$Text = $("td.ms-cellstyle.ms-vb2:contains('Very limited risk - acceptable A')");
$Text.css("background-color", "#7FFF00");
$Text = $("td.ms-cellstyle.ms-vb2:contains('Measures Required (in 6 months) - M')");
$Text.css("background-color", "#D2691E");
$Text = $("td.ms-cellstyle.ms-vb2:contains('Immediate measures required - I')");
$Text.css("background-color", "#6495ED");
$Text = $("td.ms-cellstyle.ms-vb2:contains(Stop work until measures are taken - S)");
$Text.css("background-color", "#DC143C");
</script>
Could please suggest a way out.
Thanking you in advance.
Regards,
Jayashri
Hi Jayashri,
Follow the steps to debug your JS code, preferable in IE browser
Press F12 to open your developer tool
Select Script tab
Search for your code, set debugger point by clicking on the left extreme position on line numbers
Click on Start debugging at top, if its not there in your browser just refresh the page, it will hit the debug point.
Hope it will help you in debugging your code, if you need any further details about debugging this, mail me @
[email protected]
Thanks
Shakir
Similar Messages
-
Document Library Custom View "Grouped By" only shows one group
I have created a Document Library Custom View with the "Grouped By" option turned on and grouped by a column called "media type" which has 3 possible choices. For some reason only the first group is displayed. The other
groups show that they have items in them but can't be accessed. I have expanded turned on.
Here are some screenshots:Hi zaxxon,
Please check if the above first 6 images (e.g. Managing Threating Confrontations - OneDrive for Business Tutorial)are with value "Training" and "tutorial", if yes, there should be something wrong with the grouped list view of Assets library.
Based on icons from your image, you should be using Office365 SharePoint Online, I would recommend you post this issue in our dedicated Office365 SharePoint online forum below, and I think fixing this issue would be involving back-end support engineer from
server side.
http://community.office365.com/en-us/f/156/t/236901.aspx
Office365 SharePoint Online forum
Thanks
Daniel Yang
TechNet Community Support -
Unable to add aspx file to document library using REST and JSOM in SharePoint Hosted App
Hi,
I am unable to add an aspx file to document library. I was actually trying to create a WIKI page and upload to Pages library but that wasn't working so I tried simple document library. It keeps failing with Access Denied error. I have checked
the blocked types and aspx is not included. I can upload it directly from the browser so that shouldn't be the case. I have read that it can be achieved with CSOM but I need this to work with a SharePoint Hosted App. Here is my JSOM:
factory = new SP.ProxyWebRequestExecutorFactory(appweburl);
context.set_webRequestExecutorFactory(factory);
appContextSite = new SP.AppContextSite(context, hostweburl);
oWeb = appContextSite.get_web();
oList = oWeb.get_lists().getByTitle('Documents');
fileCreateInfo = new SP.FileCreationInformation();
fileCreateInfo.set_url("mywiki.aspx");
fileCreateInfo.set_content(new SP.Base64EncodedByteArray());
fileContent = "<%@ Page Inherits=\"Microsoft.SharePoint.Publishing.TemplateRedirectionPage,Microsoft.SharePoint.Publishing,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c\" %> <%@ Reference VirtualPath=\"~TemplatePageUrl\"
%> <%@ Reference VirtualPath=\"~masterurl/custom.master\" %>";
for (var i = 0; i < fileContent.length; i++) {
fileCreateInfo.get_content().append(fileContent.charCodeAt(i));
newFile = oList.get_rootFolder().get_files().add(fileCreateInfo);
context.load(newFile);
context.executeQueryAsync(function () {
alert('yo');
}, function (sender, args) {
alert(args.get_message() + '\n' + args.get_stackTrace());
If I change the file extension to "txt", it works. Same with REST implementation, it works with "txt" but fails with "aspx". Maybe what I am trying to do will not work using JSOM or REST. Any suggestions? Your
help is always appreciated.
Regards,
kashifYour code works fine in both my on-premises and SharePoint Online. I have given the app full control, so I suspect this is a permissions issue. I would check your permissions on your appmanifest. Must be something to do with publishing permissions. Try
giving full control and work the permissions down.
Blog | SharePoint Field Notes Dev Tools |
SPFastDeploy | SPRemoteAPIExplorer -
UNABLE TO INSTALL THE PACKAGED APPLICATIONS (DOCUMENT LIBRARY)
Created new workspace, and downloaded and tried to install Document Library
from http://www.oracle.com/technology/products/database/application_express/packaged_apps/packaged_apps.html#DOC_LIB .
Installed application just fine, but when Apex attempted to install the
supporting objects, it failed. It hangs for a while and then goes to “page cannot be displayed page” When I click on refresh, and I get an error.
When browse the tables under SQL Workshop, I noticed that none of the objects have been installed for that App.
When i try to run the application, i get the following error.
ORA-06550: line 3, column 19: PL/SQL: ORA-00942: table or view does not exist ORA-06550: line 1, column 17: PL/SQL: SQL Statement ignored ORA-06550: line 5, column 26: PLS-00364: loop index variable 'C1' use is invalid ORA-06550: line 5, column 3: PL/SQL: Statement ignored ORA-06550: line 6, column 26: PLS-00364: loop index variable 'C1' use is invalid ORA-06550: line 6, column 3: PL/SQL: Statement ignored ORA-06550: line 7, column 26: PLS-00364: loop index variable 'C1' use is invalid ORA-06550: line 7,
Error setting workspace attributes.
Did anyone installed this APP? if so, was it successful?Could be possible that Samsung Galaxy Fit Processor doesn't match with the system requirements of AIR. It should be ARMv7
http://www.adobe.com/products/air/systemreqs/MOBILE SYSTEM REQUIREMENTS
Android devices
VGA: Dedicated Cortex A8 (ARMv7) 550MHz App Processor with Neon for A8 only; Hardware Vector FPU
WVGA: Dedicated Cortex A8 (ARMv7) 800MHz App Processor; Hardware Vector FPU
Google Android™ 2.2 or later
-Pahup -
Unable to open html file in document library without saving first
I've uploaded a bunch of HTML files from a DVD to a document library on our Sharepoint 2013 Enterprise server. When I try to open one of the html files it wants to save the file instead of opening it. If I choose to open the document library in Explorer
I'm able to open the html files w/o issue.
What's causing this? I know there is an option to set the file handing to permissive, but I'd rather not do that.Carl,
See this link - http://sharepoint.stackexchange.com/questions/39020/how-do-i-prevent-sharepoint-from-asking-to-download-html-files-to-my-local-machi
The allowed mime types are defined in theSPWebApplication.AllowedInlineDownloadedMimeTypes
Property
Here is small PowerShell utility function I use:
function Add-SPAllowedInlineDownloadedMimeType{
[CmdLetBinding()]
param(
[Parameter(Mandatory=$true, Position=0, ValueFromPipeLine=$true)]
[Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind]$WebApplication,
[Parameter(Mandatory=$true, Position=1)]
[string]$MimeType
process{
$actualWebApp = $WebApplication.Read()
if ($actualWebApp.AllowedInlineDownloadedMimeTypes -notcontains $mimetype)
Write-Host "Adding MIME Type..."
$actualWebApp.AllowedInlineDownloadedMimeTypes.Add($mimetype)
$actualWebApp.Update()
Write-Host "Done."
} Else {
Write-Host -ForegroundColor Green "MIME type is already added."
And it can be used like this:
Add-SPAllowedInlineDownloadedMimeType -WebApplication http://mywebapp -MimeType "text/html"
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply. -
Unable to delete column created under document library.
I've created custom column in SharePoint online (2013). I want to delete one column from my document library. In library settings all columns are showing but its not clickable to select and delete the particular column.
Please advice.Hi,
Thanks for posting your issue, you won't be able to delete the required column like Tittle, Name from the Document library. you can hide this column.
f the column is on a content type in the library, then first remove it from the content type and then from the library.
Kindly find the below URL to know about hiding and deletion of columns in Document library
http://support.microsoft.com/kb/2657619
http://www.codeproject.com/Articles/28005/To-remove-the-title-column-from-a-Sharepoint-list
http://mscerts.programming4.us/sharepoint/sharepoint%202010%20%20%20change%20or%20remove%20a%20column%20in%20a%20list%20or%20document%20library.aspx
I hope this is helpful to you, mark it as Helpful.
If this works, Please mark it as Answered.
Regards,
Dharmendra Singh (MCPD-EA | MCTS)
Blog : http://sharepoint-community.net/profile/DharmendraSingh -
Detect what the default edit form is for a document library and list using jquery
Hi,
So what I have done is with some jquery made it that when a files are dragged and dropped into a document library and there is a required field such as "Metadata" the EditForm.aspx opens up for the user to fill in the required column. I am building
the url up from what I have found in SharePoints DragDrop.js file. This is all working perfectly I just need to find a way to dynamically find what the default edit form is for that document library as I have just hardcoded like this...
g_currentControl.strSiteUrl + "/" + this.ListName + "/Forms/EditForm.aspx?ID=" + id
So I need a way to figure out what the default edit form is instead of hard coding like this in case someone creates a custom_editform.aspx or something for one of the lists.
ThanksYou can get it by hitting this REST end point via JQuery:
http://weburl/_api/Web/Lists(guid'YOURLISTGUID')/Forms
Chris Givens CEO, Architecting Connected Systems
Blog Twitter -
Document library pending view with Folder
I have a document library with content Approval setup. I have many folders and files inside them.
I can see all Pending items from library in a view with filter - Status='Pending'. This is working ok.
But I want to see the actual location of file
1. In the same view I should have a column which says the Folder name of the file.
OR
2. Display only folders with Pending items and inside it display all Pending files.
Thus display a folder only when its contains Pending files.
-Avinash!Hello,
I think that the best way to achieve it, is developing one Event Receiver or one workflow to populate one column with your required information.
In the following link you could find more information:
https://social.technet.microsoft.com/Forums/office/en-US/7fccf212-a0c8-418a-a131-ea193d30f28e/calculated-column-to-get-folder-name?forum=sharepointgeneral Link
Hope this helps. Regards -
Document library custom ribbon buttons omitted to child items
Hello,
Is there a way to omit custom ribbon buttons that are viewable at the document library level but not the content type items of the library?
I have a custom action targeting a custom document library by registration id "10777"
And it shows up in the document library, but it also shows up in the document sets.
is there a way to separate the ribbon customization between a document library and document set?Hello,
Just create a designer workflow for your requirement.
Execute that workflow when an new document gets added under library.
The functionality of the workflow is as follows
When a new document get added, you workflow will set contribute access to the owner of that document and will set read access to rest all other users. -
Update Sharepoint 2013 document library folder columns using document url
Hi All,
I have a SharePoint document library. In that library I am having folder name called Folder1. In this folder Folder1 I have 4 files in it. Now. I need to update the status column of these 4 files in Folder1 folder using the url of these 4 files.
So can anyone help me in to solve this problem. I am using SharePoint 2013 and Visual studio 2012. I want the code in C#.
Thanks & Regards,
Kishore
KishoreHi,
According to your post, my understanding is that you want to update the field within the folder.
I have made a simple code demo below to update the field within the folder, you can have a look at it.
using (SPSite site = new SPSite("http://YourSiteURL"))
using (SPWeb web = site.OpenWeb())
SPList list = web.Lists.TryGetList("Lib1");
if (list != null)
foreach (SPListItem folderItem in list.Folders)
if (folderItem.Title == "Folder1")
SPListItem item = list.GetItemById(5);
item["Status"] = "Updated";
item.Update();
Console.WriteLine("Field update successfully...");
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support -
Hi,
We have a new form that is created in Accounts Receivables(AR).The color of this form in query and normal mode is not as it is in our seeded forms. It is white in both modes. Please can you help with this.
Thanks,
Manoj.What is the difference between this form and other forms?
Did you use the TEMPLATE.fmb file to create this custom form?
Thanks,
Hussein -
Attach Documents to Custom Program Using Generic Object Services
Hi There,
I created Object type ZGOS and used in the custom program, when i try to attach documents it allows and then shows in attachment list.
But When I use that program next time that document attached is not available.
Is there any separate save Class or FM available for saving the document to the specified custom program.
I am using following code in the program,
CLEAR obj.
SET OBJECT TYPE TO 'ZGOS'
obj-objtype = objtype.
SET OBJECT KEY = REPORT NAME
SELECT SINGLE name
FROM trdir
INTO obj-objkey
WHERE name = sy-repid.
CALL GOS MANAGER WITHOUT CONTAINER (WILL BE DISPLAYED IN THE TOOLBAR)
CREATE OBJECT manager
EXPORTING
is_object = obj
EXCEPTIONS
OTHERS = 1.
Thanks in advance.Check the Naimesh Patel Blog he explain very well
http://help-abap.blogspot.com/2009/02/generic-object-services-gos-toolbar.html -
How to sort pdf documents by modified date using Javascript action
Hello,
I want to use a Javascript action to sort multiple pdf documents in a folder before I run a Javascript action that prints the last page of multiple pdf documents. I received help from this forum on the last page print script and it works perfectly. The downside is it prints in default NAME order and I need them to print in accending DATE MODIFIED order. I'm not sure if the sort function could be incorporated into the print script or if it would be a seperate code/action.
This is the script to print the last page of several pdf documents:
this.print
({bUI: false,
nStart:this.numPages-1,
bSilent: true,
bShrinkToFit: true});
I would appreciate help from anyone that is willing to share the code to "sort by DATE MODIFIED".
Adobe Acrobat 10 Pro
Windows 7
Thank you in advance,
David C.I'm not a code writer. I'm trying to streamline some operations here at work. The original code assistance was to print the last page of several pdf documents (sometimes as many as 100 to 150 at a time) without having to open each file, scroll to the bottom, Ctrl-P, current page, Print. Can't express how beneficial it was to get that to work. I realize I'm looking a gift horse in the mouth, but when it prints out, it would be great to have them print in DATE MODIFIED order since they are kept in processed order rather than alpha order.
If the two processes are too labor intensive I fully understand and appreciate all the assistance thus far. I was hoping it would be as simple as the first script coding to do the actual printing.
Thanks,
David C. -
Document Library + Items Color
Hi All,
Welcome to SharePoint products & Technologies.
How to Change the color of the Document library items based on the field values? for eg., I have a column called "Status", based on this field values the color of the items should change accordingly.
Can any one help me out on this issue.
Let me know if you are not clear or need more information
Regards,
SpUser.Hi,
Sorry for the late reply .Could not check the blogs.Here is the script to be put in content editor webpart:-
<script language="javascript" type="text/javascript">
var x = document.getElementsByTagName("td") // find all of the TDs
var i=0;
for (i=0;i<x.length;i++)
if (x[i].className=="ms-vb2") //find the TDs styled for lists
if (x[i].innerHTML=="In Process")
x[i].parentNode.style.backgroundColor='lightyellow'; // set the color
if (x[i].innerHTML=="Accepted")
x[i].parentNode.style.backgroundColor='lightgreen'; // set the color
if (x[i].innerHTML=="Not Accepted")
x[i].parentNode.style.backgroundColor='red'; // set the color
if (x[i].innerHTML=="Need More Info")
x[i].parentNode.style.backgroundColor='lightblue'; // set the color
} </script> -
Created a new SharePoint 2010 List Definition project, Sandbox deployment option. List Definition type: Documents Library. When attempting to save into the document library from Microsoft Word 2010 I get "The webpage no longer exists" error in
the File Save dialog
If I change the type of the solution to Farm solution it works as expected.
IISLOGS:
2013-12-19 10:12:01 127.0.0.1 PROPFIND / - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 207 0 0 35
2013-12-19 10:12:01 127.0.0.1 PROPFIND /sites - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 207 0 0 26
2013-12-19 10:12:01 127.0.0.1 PROPFIND /sites/team1 - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 207 0 0 30
2013-12-19 10:12:01 127.0.0.1 PROPFIND /sites/team1/Lists - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 207 0 0 32
2013-12-19 10:12:01 127.0.0.1 POST /_vti_bin/shtml.dll/_vti_rpc - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 200 0 0 10
2013-12-19 10:12:01 127.0.0.1 HEAD /sites/team1/_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.*&location=Lists/ListDefinitionProject1-ListInstance1 80 - 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 401 0 0 6
2013-12-19 10:12:01 127.0.0.1 HEAD /sites/team1/_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.*&location=Lists/ListDefinitionProject1-ListInstance1 80 - 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 401 1 2148074254 2
2013-12-19 10:12:01 127.0.0.1 HEAD /_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.*&location=Lists/ListDefinitionProject1-ListInstance1 80 0#.w|domain\username 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 200 0 0 23
2013-12-19 10:12:01 127.0.0.1 GET /sites/team1/_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.docx&location=Lists%2FListDefinitionProject1-ListInstance1 80 - 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 401 0 0 10
2013-12-19 10:12:01 127.0.0.1 GET /sites/team1/_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.docx&location=Lists%2FListDefinitionProject1-ListInstance1 80 - 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 401 1 2148074254
2
2013-12-19 10:12:01 127.0.0.1 GET /_vti_bin/owssvr.dll dialogview=FileSave&FileDialogFilterValue=*.docx&location=Lists%2FListDefinitionProject1-ListInstance1 80 0#.w|domain\username 127.0.0.1 non-browser;+(Windows+NT+6.1.7601) 410 0 0 34
2013-12-19 10:12:01 127.0.0.1 PROPFIND /sites/team1/Lists/ListDefinitionProject1-ListInstance1 - 80 0#.w|domain\username 127.0.0.1 Microsoft-WebDAV-MiniRedir/6.1.7601 207 0 0 36Hi,
According to your post, an error occurred when you used the custom Documents Library(List Definition using sandbox solution).
Please check whether you have removed <ContentTypeRef/> in the <ContentTypes/> tag of Schema.xml file in your project.
Here is a sample about list definition deployed as a sandbox solution, you can take a look at:
http://sharepointbuzzer.com/2010/10/21/list-definition-using-sandbox-in-sharepoint-2010/
Best Regards
Dennis Guo
TechNet Community Support
Maybe you are looking for
-
I have attempted to update my software update several times and each time I get an error stating that it cannot save. I am not real familiar still with the MAC so I'm not sure what the issue it. Please Help!!
-
I have been asked by the head of the organization to enforce a 30 day retention policy for ALL emails in everyone's Outlook (Exchange 2010) - Inbox, Sent, Deleted, etc. (he deletes EVERY message as soon as he read it). So I went into the EMC and f
-
Authorization problem: All computers deauthorized but can't add new compute
I just bought a new macbook pro and reached my max of 5 computers in my itunes account. I went ahead and deauthorized all computers in my itunes account to start fresh but I'm still unable to sync my iphone. The first message I get when I try is "Thi
-
File and folder sharing and permissions.
Many times when we copy files or folders to another mac computer, their permissions change, and many times the new user can not open it, until the file or folder permissions are changed. It start happen with MacOX 10.5, and still is happening with 10
-
Filtering more than one node with the command SAPBEXFilterValue
Hello everybody, i have an issue with the Function SAPBEXsetFilterValue(intValue As String, Optional hierValue As String, Optional atCell As Range) As Integer Filtering with cell atCell (if this parameter is missing, then the active cell is taken as