Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var $v_8 = this.$E_0.getElementsByTagName('a');
- <input id="Submit1" type="submit" class="ms-ButtonHeightWidth" style="width: 120px;" onclick="javascript:ShowDialog(MyProject.Utilities.FormMode.NewForm, $('#FCChoice').val(), null, siteUrl, WidgetRequestTrackerListId, null);" value="Create New Request" />
- var fullSiteUrl = '<%= SPContext.Current.Web.Url %>';
- function ShowDialog(mode, contentType, id, siteUrl, listId, parentId, parentFy, parentOC) {
- var url = fullSiteUrl + '/_layouts/ABCCo/Widget/' + mode + 'Form.aspx?ListId=' + listId + '&';
- var options = SP.UI.$create_DialogOptions();
- options.width = 700;
- options.height = 600;
- options.dialogReturnValueCallback = ModalCallback;
- if (parentId !== null && parentId !== undefined)
- url += 'ParentID=' + parentId.toString() + '&';
- if (mode !== MyProject.Utilities.FormMode.NewForm)
- url += 'ID=' + id.toString() + '&';
- if (contentType === MyProject.Constants.ContentTypes.WidgetRequest.Id) {
- url += 'ContentTypeId=' + MyProject.Constants.ContentTypes.WidgetRequest.Id + '&';
- options.title = mode + " " + MyProject.Constants.ContentTypes.WidgetRequest.Name;
- }
- else if (contentType === MyProject.Constants.ContentTypes.WidgetFactoryRequest.Id) {
- url += 'ContentTypeId=' + MyProject.Constants.ContentTypes.WidgetFactoryRequest.Id + '&';
- options.title = mode + " " + MyProject.Constants.ContentTypes.WidgetFactoryRequest.Name;
- }
- else if (contentType === MyProject.Constants.ContentTypes.WidgetOrder.Id) {
- url += 'ContentTypeId=' + MyProject.Constants.ContentTypes.WidgetOrder.Id + "&ParentFY=" + parentFy + "&ParentOC=" + parentOC;
- options.title = mode + " " + MyProject.Constants.ContentTypes.WidgetOrder.Name;
- }
- else if (contentType === MyProject.Constants.ContentTypes.WidgetManufactured.Id) {
- url += 'ContentTypeId=' + MyProject.Constants.ContentTypes.WidgetManufactured.Id + "&ParentFY=" + parentFy + "&ParentOC=" + parentOC;
- options.title = mode + " " + MyProject.Constants.ContentTypes.WidgetManufactured.Name;
- }
- else if (contentType === MyProject.Constants.ContentTypes.WidgetTransaction.Id) {
- url += 'ContentTypeId=' + MyProject.Constants.ContentTypes.WidgetTransaction.Id + "&ParentFY=" + parentFy + "&ParentOC=" + parentOC;
- options.title = mode + " " + MyProject.Constants.ContentTypes.WidgetTransaction.Name;
- }
- else if (contentType === MyProject.Constants.ContentTypes.WidgetTransactionOrder.Id) {
- url += 'ContentTypeId=' + MyProject.Constants.ContentTypes.WidgetTransactionOrder.Id + "&ParentFY=" + parentFy + "&ParentOC=" + parentOC;
- options.title = mode + " " + MyProject.Constants.ContentTypes.WidgetTransactionOrder.Name;
- }
- else if (contentType === MyProject.Constants.ContentTypes.WidgetTransactionManufactured.Id) {
- url += 'ContentTypeId=' + MyProject.Constants.ContentTypes.WidgetTransactionManufactured.Id + "&ParentFY=" + parentFy + "&ParentOC=" + parentOC;
- options.title = mode + " " + MyProject.Constants.ContentTypes.WidgetTransactionManufactured.Name;
- }
- //SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
- SP.UI.ModalDialog.showModalDialog(options);
- }
- function ModalCallback(result, returnValue) {
- if (result == SP.UI.DialogResult.OK && returnValue != null) {
- var itemOptions = JSON.parse(returnValue);
- if (itemOptions.FormMode !== MyProject.Utilities.FormMode.DisplayForm) {
- BindViewModel();
- if (itemOptions.ContentType === MyProject.ContentTypes.WidgetFactoryRequest.Name || itemOptions.ContentType === MyProject.ContentTypes.WidgetRequest.Name) {
- // Expand none
- }
- else if (itemOptions.ContentType === MyProject.ContentTypes.WidgetOrder.Name || itemOptions.ContentType === MyProject.ContentTypes.WidgetManufactured.Name || itemOptions.ContentType === MyProject.ContentTypes.WidgetTransaction.Name) {
- // Expand Request
- }
- else if (itemOptions.ContentType === MyProject.ContentTypes.WidgetTransactionOrder.Name || itemOptions.ContentType === MyProject.ContentTypes.WidgetTransactionManufactured.Name) {
- // Expand Transaction
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement