What i will write down here in this article is how to summarize a table, and create a graphic based on it. I will also explain how to do it, we're going to break open SharePoint so you can do finally what you want to do with it. While we wont need more access then well basically SharePoint Designer, or using only the web browser is possible too!. But with SPD (SharePoint designer) we could do a bit more. I will keep in mind that most of you don't code, or are new to SharePoint, JavaScript CAML Jquery etc etc. You should know HTML tags, i am not going to explain those. Code will be briefly explained, enough to get you started. I would advice to use some kind of editor to write Jscript in, for example Notepad++ / Editra / ... etc Also to test locally jscript its handy to have locally on your client pc a webserver A real small one can be downloaded here Tinyweb also read its small manual. It is less then 1 Mb. It installs without GUI, its simply active once started and that's enough if you want to play with scripting.
<html><head></head><body
<div id=
"MyStuff"
>
You will see me <br>
When nothing has been pressed
</div>
<script type=
"text/javascript"
function
changeText(){
document.getElementById(
'MyStuff'
).innerHTML="
<b>I've changed !!</b>"
;
}
</script>
<input type=
'button'
onclick=
'changeText()'
value=
'Change Text'
/>
</body></html>
var
mycar =
"That's my car"
quote =
'It think he said "you are using double quotes", and finished with a single one'
Although its maybe a bit silly the previous page we made we could put its script part on SharePoint to. Note that it would be a fragment for a normal .aspx based page. .aspx is a complex HTML type on which SharePoint is based, if your interested some informative information can be found
Now for the Rent list, change a view to include also the socks column, it might be more handy for the moment to not show it as a calendar view. Just a plain list, with created by, title, socktype and price. Now add about 10 calendar items. Try to use different sock bookings for the Rent list title just enter some imagiairy names of people who rent your socks.
// Bind to our list
ViewItem(){
console.log(
"start function view item"
);
// console.log => firebug debug
context =
new
SP.ClientContext.get_current();
web = context.get_web();
list = web.get_lists().getByTitle(
'Rent'
// CAML query to our list
query = SP.CamlQuery.createAllItemsQuery();
allItems = list.getItems(query);
context.load(allItems,
'Include(Title,SockType)'
context.executeQueryAsync(Function.createDelegate(
this
,
.success), Function.createDelegate(
.failed));
success() {
// read each CAML item result with a while loop.
TextFiled =
""
ListEnumerator =
.allItems.getEnumerator();
while
(ListEnumerator.moveNext())
{
currentItem = ListEnumerator.get_current();
TextFiled += currentItem.get_item(
'Title'
) +
'-'
+currentItem.get_item(
'SockType'
).get_lookupValue() +
'<br>'
// alert(TextFiled); // remove rem mark to get a poup
).innerHTML = TextFiled;
//remind our first example
failed(sender, args) {
alert(
"failed. Message:"
+ args.get_message());
</script><a onclick=
"Javascript:ViewItem();"
href=
"#"
>View my Items</a>
NOTE: I will continue writing this article later make it a favorite if you wish I hope to finish it soon (so i have a good reminder of all i did the past days). This will cost me a few evenings to write, for now its time to sleep for me.
Richard Mueller edited Revision 29. Comment: Fixed blank headings and duplicate <a name> tags in HTML
Richard Mueller edited Revision 28. Comment: Removed (en-US) from title, added tag
Richard Mueller edited Revision 27. Comment: Fixed typo in code
Carsten Siemens edited Revision 26. Comment: fixed typo
PGT2008 edited Revision 25. Comment: found a typo
Craig Lussier edited Revision 24. Comment: added en-US to tags and title
Ed Price - MSFT edited Revision 22. Comment: Header refinement. Added TOC.
Ed Price - MSFT edited Revision 21. Comment: Updated title casing. Fantastic article!
Richard Mueller edited Revision 30. Comment: Replace RGB values with color names in HTML to restore colors