0

I have a custom list, with some columns. In order to design my list with colors, I used calculated columns with a Content Editor Web Part which contains my script (JavaScript).

I used this script : Path to SharePoint

It works perfectly, my list have some colors, I just have one issue, the filtering drop-downs columns doesn't render HTML or Plain text but instead my HTML formula as filter:

DIV style='font-weight:bold etc...

It's not very readable/usefull for the customers/users. I'd like to change that, and display a user-friendly filtering text.

I'm using MOSS (SharePoint 2007), and I don't have access to SharePoint Designer, a solution within a CEWP would be perfect.

Any help would be greatly appreciated.

2
  • Just to clarify, where there's text for the date column(let's say you have a date column), and where you can filter the list elements based on the date column, the text for it is showing the actual HTML element?
    – Brandon C.
    Commented Jun 16, 2014 at 8:03
  • When you're looking at your default view, on the column's title, you can click to filter your column right? If it's a calculated column (which i used to apply color to my list), the filtering drop-downs menu doesn't display plain text nor HTML, but instead my calculated formula : DIV style='font-weight:bold etc...
    – Funnybear
    Commented Jun 16, 2014 at 8:31

1 Answer 1

0

What you could do, is since you are already using Javascript, is go into your list view .aspx page, and find the area that defines the view header. You will find each field containing the text for the column views. Assign each field a unique ID,

<th class="something" id = "column1" ...>

Then, in your javascript, add something like:

<script type="text/javascript">
 document.getElementByID("column1").style.color = 'black';
 document.getElementByID("column1").innerHTML = "My new Name";
 ...
</script>

On page load, it'll just reset the names back to what you originally want.

14
  • I cannot open my list view .aspx page in SharePoint Designer: "You do not have permission to do this operation. Ask your web administrator to change your permissions ... "
    – Funnybear
    Commented Jun 16, 2014 at 8:50
  • Ahh...You know what, I've been working with JS so much lately, that it seems it is always on my mind. You don't need JS to do this. Do you have the rights to edit list information? You can simply go into list options from the website or designer, select the column name you want to modify, and just modify the title to whatever you want.
    – Brandon C.
    Commented Jun 16, 2014 at 8:55
  • @Funnycuni my question to you though, is that after reading the article, is that you have one calc column for te formula, which includes changing the color, and another column with the HTML formula to format it. It would seem that the format column would have your HTML titel for whatever reason. Does the user need to see that? Why not just hide it from their view?
    – Brandon C.
    Commented Jun 16, 2014 at 9:01
  • I tried it, but it doesn't work. It's all the possibilities for filtering that aren't displayed in plain text or HTML. What I colored is my fields in my column, so when I try to filter it, instead of displaying me all my fields in the drop-downs filtering menu, it display me my calculated formula. Here is a screenshot of my problem, maybe it will be more usefull than my words. As you can see, it should display my 3 possibilities (New, In progress, Closed) for filtering in the column "Status". img4.hostingpics.net/pics/309425Filter.jpg
    – Funnybear
    Commented Jun 16, 2014 at 10:09
  • Okay, so I think I figured it out. From what I read from your reference, you have the HTML text in the status column, which holds your options as well. From what I read, you need to have the one calculated column with the New, In progress, and closed fields, which is your status column. That column will hold the formula for (like the =CHOOSE(... stuff). Then, you need ANOTHER column, which will hold the HTML tag, referencing the calculated column. Right now, it looks like you have the HTML in the Status columns, which is why it shows up when filtering.
    – Brandon C.
    Commented Jun 16, 2014 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.