Showing posts with label Lists. Show all posts
Showing posts with label Lists. Show all posts

Saturday, July 6, 2013

Remove the Group Label from the “Group By” List Views

This had to be simple java-script, so a quick search on the internet returned me a 2011 Blog post by “Alexander Bautx” which works “AS-IS”. I had to just replace the single-quotes (‘) by deleting and inserting it back again for all of it’s existence, and that’s it. Probably it was due to the copy-paste formatting issue. I have highlighted the change below, which appears at 4 places in his code.

But this was awesome!! Kudos to Alexander.

Note: You may not need the first line reference for the jquery, if you already have it in your master page.

$(this).find("a:last")[0].nextSibling.nodeValue = '';

Saturday, April 20, 2013

Formatting Texts in a SharePoint List Item columns

This could be an old-school  thought of wanting to apply different formats to the values stored in list columns.

Well, one can definitely go a number of ways to achieve that, but here’s an approach when an end-user can drop some code in a calculated field to achieve this very easily and more precisely, getting to a number of different formatting styles.

Format 1: Displaying a Hyperlink Text in a calculated column

Create three columns in a list as below:

Column1: [ActualURL] of type “Single line of text”. (We will store values like “http://neerajch.blogspot.com” in this column)

Column2: [URLTitle] of type “Single line of text”. (We will store values like “NeerajCh” in this column)

Column3: [HyperlinkHTML] of type “Calculated”.

Type the below in the Formula box:

=CONCATENATE("<DIV><a href='",ActualURL,"'>",URLTitle,"</a></DIV>")

Select “Number (1, 1.0, 100)” in the [Data Type returned from this formula] section.

Leave the “Automatic” in [Number of Decimal Places].

That’s it. Hit OK and create one new list entry with values mentioned above. [Title] can be anything.

You should see something like this. Hurray !!!

image

Now that “Concatenated” formula piece can be a real handy and fruitful, if used wisely. Let’s see another small example.

Format 2: Displaying a Hyperlink Text in a calculated column as BOLD

With the same configurations for the list columns as above, we modify the formula to include <b> & </b> tags within the <DIV>.

=CONCATENATE("<DIV><b><a href='",ActualURL,"'>",URLTitle,"</a></b></DIV>")

And now you see something like this:

image

Wow, I know, you must be smiling. Smile Nothing great here!! Just plain HTML. And that is my intent.

Let the things be as simple as they can be, for this has to be done by an end user not a developer/designer.

So the end users now have a great handy tool and can make it even powerful, if they can extract more complex HTMLs from their peer developers and embed here.

Wednesday, September 9, 2009

Customizing "Created By" column in Survey lists

Well, I had'to modify the display of a column in a Survey, where it was required to get the email ID displayed instead of the User's name.
By default, you cannot edit the “Created by” in the question lists. But there's a workaround for you to edit this column as per the below steps:

1. Open your survey, click "Survey Settings" (You will need the Admin rights for this).
2. In the Questions section, click any question of your survey;
3. Change the URL parameter in the Browser:
set Field=Author,
Change the aspx page to FldEditEx.aspx
4. The URL should resemble something like this:
http://yourserver/_layouts/FldEditEx.aspx?List=yourlistGUID&Field=Author
(replace "yourserver" and "yourlistGUID" accordingly)

After this you can select the field you want to display in “Created by”, which can be anything from the dropdown list:
- email
- ID
- Firsname
- Lastname, etc.

Things to remember:
- Page to use: "FldEditEx.aspx"
- Use the respective Internal column names for the columns to modify:
[Created By] = “Author”
[Modified] = “Editor”
[View Response] = "DisplayResponseNoMenu"

Interesting !!! kind of hacking the SharePoint.