Manager
fd
Forms designer manager global variable.
Manager
Forms designer manager class.
Methods:
field(internalName) | Returns field by its internal name. Returns object of Field type. Ex.: fd.field('Title') |
onsubmit(handler) | Adds handler on save event. Ex.: fd.onsubmit(function(){ return confirm('Are you sure you want to save changes?'); }); |
save() | Returns save button jquery-object |
cancel() | Returns cancel button jquery-object |
saveText(text) | Gets or sets save button title. Ex.: fd.saveText('Save task'); |
cancelText(text) | Gets or sets cancel button title. Ex.: fd.cancelText('Return'); |
openFormInDialog (filename, queryParams, callback) | Opens specified form in a dialog. filename 'fd_Contact_Display.aspx' queryParams {ID: 3, Source: '/'} callback function(){ alert('Dialog is closed.'); } Ex.: fd.openFormInDialog('fd_Contact_Display.aspx'); |
openForm(filename, queryParams) | Redirects to specified form. filename queryParams Ex.: fd.openForm('fd_Contact_Display.aspx'); |
backToPrevForm() | Redirects to the previously opened form. Ex.: fd.backToPrevForm(); |
getSourceID() | Returns ID of the parent item if the current form is opened from the parent form and null otherwise. Ex.: fd.getSourceID(); |
setUrlParam(uri, key, value) | Adds or updates query parameter in provided URL with a specified value and returns a new URL. url key value Ex.: fd.setUrlParam(window.location.href, 'FDRedirectWithID', 'fd_Item_Edit.aspx?ID='); |
getUrlParam(uri, key) | Returns value of a specified query parameter from provided URL. url key Ex.: fd.getUrlParam(window.location.href, 'Source'); |
sourceFormParam (value) | Gets or sets ‘Source’ query parameter of the URL which is contained in action attribute of the form. Source parameter contains URL of the page where users will be redirected after the submission of the form. If value is not specified the function returns the current value of ‘Source’ parameter. Ex.: fd.sourceFormParam(window.location.href); |
updateDroppedDocuments (container, fieldValues) | Defines default values for documents dropped onto the specified Related items control. Added in Forms Designer 2.8.8. Supported by SharePoint 2013/2016 and SharePoint Online only container fieldValues { Lookup: GetUrlKeyValue('ID'), Status: 'Closed' } Note: field names of the object have to match internal names of the related library. Ex.: fd.updateDroppedDocuments($('.related-docs'), { Event: GetUrlKeyValue('ID') }); |
updateDroppedDocuments (container, callback) | Alternatively, you can pass on a function, that takes the newly uploaded document as a parameter, instead of an object. This functionality is added in Forms Designer 3.1.4. Supported by SharePoint 2013/2016 and SharePoint Online only. container callback Ex.: fd.updateDroppedDocuments($('.related-docs'), function(listItem) { var result = $.Deferred(); return result; }); You can read more about it here |
populateFieldsInGrid (container, fieldValues) | Defines default values for items added into the specified Related items control in Quick Edit mode (Grid mode). Added in Forms Designer 3.0.4. Supported by SharePoint 2013/2016 and SharePoint Online only container fieldValues { Lookup: GetUrlKeyValue('ID'), Date: '9/15/2015' } Note: field names of the object have to match internal names of the related list. fd.populateFieldsInGrid($('.related-items'), { Parent: '{CurrentItem}', User: _spPageContextInfo.userId, Text: 'Default Text', Date: '2/23/2017' }) |
isMobileDevice() | Returns a Boolean value representing if current user agent is a mobile device. Ex.: fd.isMobileDevice(); |
isTabletDevice() | Returns a Boolean value representing if current user agent is a tablet device. Ex.: fd.isTabletDevice(); |
tabControl(index) | Returns a JQuery object of the tab control specified by index. Ex.: fd.tabControl(4); |
accordion(index) | Returns a JQuery object of the accordion control specified by index. Ex.: fd.accordion(1) |