function getCashAdvanceSelectors(selected) {
datacontext.getCashAdvanceChoices()
.then(function (data) {
var arr = [];
data.forEach(function (entry) {
var ok = false;
if (selected != null && selected.indexOf(',') > -1) {
selected.split(',').forEach(function (item) {
if (entry == item) {
ok = true;
}
});
} else if (selected != null) {
if (entry == selected) {
ok = true;
}
}
var obj = {
name: entry,
selected: ok
};
arr.push(obj)
});
vm.CAItems = arr;
});
}
Wednesday, December 10, 2014
Tuesday, December 9, 2014
Check Box Data POST AngularJS
function getCashAdvanceSelectors() {
datacontext.getCashAdvanceChoices()
.then(function (data) {
//vm.CAItems = data;
var arr = [];
data.forEach(function (entry) {
var obj = {
name: entry,
selected: false
};
arr.push(obj)
});
vm.CAItems = arr;
});
}
datacontext.getCashAdvanceChoices()
.then(function (data) {
//vm.CAItems = data;
var arr = [];
data.forEach(function (entry) {
var obj = {
name: entry,
selected: false
};
arr.push(obj)
});
vm.CAItems = arr;
});
}
Friday, November 21, 2014
Angular Filters : Have Fun with Angular Filters
http://onehungrymind.com/fun-with-angularjs-filters-paleo-edition/
Thursday, November 13, 2014
Retrieve Author / Lookup Fields from Sharepoint Lists
Reference :
How about a simple query:
For exampe; in order to request all the field values including projected fields (like Author and Editor user fields) the following query could be used:
/_api/web/lists/getbytitle('<list title>')/items(<item id>)
which will return all the field values for a list item with some limitation for User/Lookup fields:- only lookup id values will be retrieved.
*
to select all the fields plus to specify projected fields explicitly:/_api/web/lists/getbytitle('<list title>')/items(<item id>)?$select=<projected field>/Id,<projected field>/Title,*&$expand=<projected field>
For exampe; in order to request all the field values including projected fields (like Author and Editor user fields) the following query could be used:
/_api/web/lists/getbytitle('<list title>')/items(<item id>)?$select=Author/Id,Author/Title,Editor/Id,Editor/Title,*&$expand=Author,Editor
.js file
function getIssueTrackerPartials()
{
var deferred = $q.defer();
$http({
method: 'GET',
url: '_api/web/lists/getbytitle(\'Issue Tracker\')/items?$select=Id,Title,IssueDescription,IssueStatus,Severity,Modified,Created,DepartmentAD,Author/Title&$expand=Author&$orderby=Title'
}).success(function (data) {
common.logger.log("retrieved LP partials via ngHttp", data, serviceId);
deferred.resolve(data.d.results);
}).error(function (error) {
var message = "data context ngHttp error: " + error.message;
common.logger.logError(message, error, serviceId);
deferred.reject(error);
});
return deferred.promise;
}
.HTML
<td class="ms-cellstyle ms-vb2">
<div class="ms-rtestate-field" data-ng-click="vm.gotoItem(lp)">{{lp.Author.Title}}</div>
</td>
Wednesday, October 29, 2014
Retrieve Data From 2 or More Lists in CSOM
<!-- Retrieve Data For Events-->
<script type="text/javascript">
window.onload = loadv;
function loadv() {
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', retrieveAllListPropertiesEvent);
}
var collListItemEvent;
var collListItemAnnouncement;
function retrieveAllListPropertiesEvent() {
var clientContext = new SP.ClientContext.get_current();
var clientContextAnn = new SP.ClientContext.get_current();
var oWebsite = clientContext.get_web();
var oWebsiteAnn = clientContextAnn.get_web();
var collList = oWebsite.get_lists().getByTitle('OoredooEvents');
var collListAnn = oWebsiteAnn.get_lists().getByTitle('OoredooAnnouncement');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<View><Query><OrderBy><FieldRef Name=\'ID\' Ascending=\'FALSE\'/></OrderBy></Query><RowLimit>4</RowLimit></View>');
collListItemEvent = collList.getItems(camlQuery);
collListItemAnnouncement = collListAnn.getItems(camlQuery);
clientContext.load(collListItemAnnouncement)
clientContextAnn.load(collListItemEvent);
clientContextAnn.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceededAnn), Function.createDelegate(this, this.onQueryFailedAnn));
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceededEvent), Function.createDelegate(this, this.onQueryFailedEvent));
}
function onQuerySucceededAnn(){
var countAnn = 0;
var listEnumeratorAnn = collListItemAnnouncement.getEnumerator();
while(listEnumeratorAnn.moveNext()){
var oListAnn = listEnumeratorAnn.get_current();
countAnn++;
$("#AnnouncementTitle" + countAnn).text(oListAnn.get_item("Title"));
$("#AnnouncementDesc" + countAnn).text(oListAnn.get_item("Values"));
}
var count = 0;
var listEnumerator = collListItemEvent.getEnumerator();
var imgID = '';
while (listEnumerator.moveNext()) {
var oList = listEnumerator.get_current();
count++;
$("#EventTitle" + count).text(oList.get_item("Title"));
imgID = 'EventURL' + count;
var imageSrc =oList.get_item("url");
var input = document.getElementById(imgID);
input.src = imageSrc;
}
}
function onQueryFailedAnn(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
</script>
<!--End of Retrieve Data For Events-->
Thursday, October 23, 2014
Wednesday, October 22, 2014
Adding Host header and Access
1. IIS Bounding - mycompany.int , Port:33457
2. Alternate Access Mapping in sharepoint - Host header add : mycompany.int
3. DNS : Faward Lookup Zones
4. Network -> Change Adapter Settings ->add mycompany.int
Tuesday, October 21, 2014
How to Change Sharepoint Ribbon Name Using PS
PS C:\Users\Administrator> $app = Get-SPWebApplication -Identity http://spsvr:1111
PS C:\Users\Administrator> $app.SuiteBarBrandingElementHtml = "<div class='ms-core-brandingText'></div>"
PS C:\Users\Administrator> $app.Update()
PS C:\Users\Administrator>
Thursday, October 16, 2014
How to Setup a Sharepoint App Server
http://msdn.microsoft.com/en-us/library/fp179923(v=office.15).aspx
Granting Access
1. Create a New User (dgk)
2.add that user to AD (to Administrators group and Domain Admin Groups)
3.Goto Central Administrator
4. Security -> Manage the farm administrators group -> Add Newly Create user there
5. Security -> Configure service accounts -> go to your web application -> change Select an account for this component to another account
6. Go to MSSQL Server management studio -> SharePoint_Config -> Security -> Users -> add user to it and grant permission to -> Membership -> DB Owner and SecurityAdmin
7. Owned Schemas -> DB Owner
8.Refresh the DB
9.Again Go to
Security > Configure service accounts -> go to your web application -> change Select an account for this component to Previous Account/ User
10. Done!
For More :
http://www.sharepoint-journey.com/app-development-in-sharepoint.html
http://algrandi.azurewebsites.net/index.php/sharepoint-2013-error-occurred-in-deployment-step-install-app-for-sharepoint/
http://www.sharepoint-journey.com/whats-new-for-endusers-in-sharepoint-2013.html
Retrieve List Items From (JavaScript)
<script type="text/javascript">
window.onload = load;
function load() {
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', retrieveAllListProperties);
}
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', retrieveAllListProperties);
}
var collListItem;
function retrieveAllListProperties() {
var clientContext = new SP.ClientContext.get_current();
var oWebsite = clientContext.get_web();
var collList = oWebsite.get_lists().getByTitle('OoredooAnnouncement');
var clientContext = new SP.ClientContext.get_current();
var oWebsite = clientContext.get_web();
var collList = oWebsite.get_lists().getByTitle('OoredooAnnouncement');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<View><Query><OrderBy><FieldRef Name=\'ID\' Ascending=\'FALSE\'/></OrderBy></Query><RowLimit>4</RowLimit></View>');
camlQuery.set_viewXml('<View><Query><OrderBy><FieldRef Name=\'ID\' Ascending=\'FALSE\'/></OrderBy></Query><RowLimit>4</RowLimit></View>');
this.collListItem = collList.getItems(camlQuery);
clientContext.load(collListItem);
clientContext.load(collListItem);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
}
function onQuerySucceeded() {
var listInfo = '';
var count = 0;
var listEnumerator = collListItem.getEnumerator();
var listInfo = '';
var count = 0;
var listEnumerator = collListItem.getEnumerator();
while (listEnumerator.moveNext()) {
var oList = listEnumerator.get_current();
listInfo += 'Title: ' + oList.get_item("Title");
count++;
$("#AnnouncementTitle" + count).text(oList.get_item("Title"));
$("#AnnouncementDesc" + count).text(oList.get_item("Values"));
var oList = listEnumerator.get_current();
listInfo += 'Title: ' + oList.get_item("Title");
count++;
$("#AnnouncementTitle" + count).text(oList.get_item("Title"));
$("#AnnouncementDesc" + count).text(oList.get_item("Values"));
}}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
</script>
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
</script>
Subscribe to:
Posts (Atom)