TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Swetha
NA
196
25.6k
How to get image column url of sharepoint using JSOM
Dec 9 2016 5:11 AM
I got image column by the foll.. code,
function loadStructure() {
// alert("test");
//Querying SP using SCOM
var context = new SP.ClientContext.get_current();
var web = context.get_web();
var list = web.get_lists().getByTitle("Employee"); //Employee is SP List containing heirarchy data of the Orgnization
var viewXml = '<View><RowLimit>1200</RowLimit></View>';
var query = new SP.CamlQuery();
query.set_viewXml(viewXml);
this.items = list.getItems(query);
context.load(items, 'Include(Title, Manager,Designation,Image)');// getting image colum
context.add_requestSucceeded(onLoaded);
context.add_requestFailed(onFailure);
context.executeQueryAsync();
function onLoaded() {
//Adding SCOM return objects to an array
var tasksEntries = [];
// alert('itemsCount');
var itemsCount = items.get_count();
//alert(itemsCount);
for (i = 0; i < itemsCount; i++) {
var item = items.itemAt(i);
var taskEntry = item.get_fieldValues()
;/
/getting field values of each item
tasksEntries.push(taskEntry);//
and Pushing into array
tasksEntries
-------
Binding image ,designation of items tooltip
-------
for (var i = 0; i < tasksEntries.length; i++) {
var url=tasksEntries[i].Image.$1_1;//
getting image url in $1_1 if url in image column exists
if there is no image url to any item there is no property $1_1
$("div[title=\"" + tasksEntries[i].Title + "\"]").balloon({
contents: '<p style="text-align:center;"><img src ="'+url+'"/></p></br><ul style="list-style:none;"><li style="width:200px;"> Designation :' + tasksEntries[i].Designation + '</li></ul>'
});
what's the issue is if url is there in image column showing image and designation if ther is no image url not showing the tool tip at all.what needed is if no image exists it has to show tool tip with desingation. How can i acheieve this.Any Suggestions pls
Reply
Answers (
1
)
fixing page cannot displayed error in sharepoint site collec
page cannot display error