NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

Ext.ns('cms.admin.slimfast.doctype.rad');

cms.admin.slimfast.doctype.rad.dataTypeId = 110054;

cms.admin.slimfast.doctype.rad.createLayoutDrivenForm = function(dataTypeId,getData){
var fields = dms.common.getFieldObject(1, dataTypeId);
/*var layoutId = makeSynchAJAXCall('/DMS/slimfast/findLayoutIdForForm.do', 'POST');
var formLayoutId=JSON.parse(layoutId).rows;*/
var layoutArray = dms.common.getEditLayoutsList(388,dataTypeId,false);
var page1 = Ext.create('Ext.panel.Panel', {
itemId: 'page1',
layout: 'anchor',
defaults: {
labelWidth: "100%",
style:{padding:'10px 10px 0px 10px'}
},
border:false,
items: []
});

var pages = [page1];

var hboxIV = {
itemId: 'HboxId',
layout: 'column',
cls: 'expand-panel',
border:false,
layoutConfig: {
align: 'stretch'
},
defaults: {
bodyStyle: 'padding:10px' ,
flex: 1
},
items: [{
border: true,
bodyStyle: 'border-color:#fff',
items: [page1]
}]

};

var maxLength = 0;
for (var i = 0; i < layoutArray.length; i++) {
if (layoutArray[i] == undefined) {
return;
}
var colLength = layoutArray[i].length;
if (colLength > maxLength) {
maxLength = colLength;
}
}

var formFieldspanel = Ext.create('Ext.form.Panel', {
standardSubmit: true,
frame: true,
monitorValid: true,
animCollapse: false,
border:false,
formBind:true,
layout:'anchor',
scrollable:true,
buttonAlign: 'center',
autoScroll:true,
items: [hboxIV],
listeners: {

afterrender: function (form) {
for ( var i = 0; i < layoutArray.length; i++) {
var fieldArray = dms.common.createFieldProperties(layoutArray[i]);//sets field properties like mandatory, editable,hidden or value fields etc
var planeFields = fieldArray[0];
var fieldProps = fieldArray[1];
var merchantAccountArray = dms.common.createDeatailsDisplayArray(planeFields,fields); //maps field type in java with type in js display
var details = [];
for(var j=0; j<planeFields.length;j++) {

var fieldId = planeFields[j];
details = merchantAccountArray[j];
if(details != undefined) {
var props = fieldProps[fieldId];
var customFields = {
storeName : props.store,
valueField : props.valueField,
mode:'remote'
};
var isTimeFormatExists = props.isTimeFormatExists;
var isHelpEnabled=details[9];
if(details[3] == 'Date'){
details[3] = 'SimpleDate';
}else if(details[3] == 'SpecialValueField' || details[3] == 'SpecialAmountField'){
details[3] = 'TextField';
}else if(details[3] == 'CheckBoxCmp'){
customFields['toolTip']=details[5];
customFields['isHelpEnabled']=isHelpEnabled;
}
if(props.mandatory == true ){
details[1] = details[1]+'<span style="color:red;" ext:qtip="This field is required"> * </span>'; //mandatory show in UI
}

var comp = dms.common.createAndAddComponent(details[0],details[1],details[3],'', pages[i], "",dataTypeId,customFields, false,null,null,undefined);

if(props.mandatory == true ){
comp.allowBlank=false;
comp.regex = /^[^s]+(s+[^s]+)*$/;
}

if(getData != null)
{
//ADD CUSTOM CONDITIONS FOR YOUR FIELDS HERE
if(fieldId == 'appUrl'){
comp.setValue(getData.get('appUrl'));

}else if(fieldId == 'bulkExportLimit'){
comp.setValue(getData.get('bulkExportLimit'));
comp.setMinValue(0);

}
else if(fieldId == 'selectAllLimit'){
comp.setValue(getData.get('selectAllLimit'));
comp.setMinValue(0);

}
else if(fieldId == 'extJsDateFormat'){
comp.setValue(getData.get('extJsDateFormat'));
}
else if (fieldId.includes(".")){
comp.setRawValue(getData.get(fieldId));
}
else if(fieldId == 'mlSupportPMTDI'){
comp.items.items[0].setWidth(90);
if(getData.get('mlSupportPMTDI') === true){
comp.items.items[0].setValue(true);
}
else{
comp.items.items[1].setValue(true);

}
// comp.setValue(getData.get('mlSupportPMTDI'));
}
else if(fieldId == 'elasticSearchEnabled'){
comp.items.items[0].setWidth(90);
if(getData.get('elasticSearchEnabled') === true){
comp.items.items[0].setValue(true);
}
else{
comp.items.items[1].setValue(true);

}
// comp.setValue(getData.get('mlSupportPMTDI'));
}
else if(fieldId == 'userToMultipleCustomersAssociation'){
comp.items.items[0].setWidth(90);
if(getData.get('userToMultipleCustomersAssociation') === true){
comp.items.items[0].setValue(true);
}
else{
comp.items.items[1].setValue(true);

}
}

else {
//comp.store.load();
comp.setValue(getData.get(fieldId));
comp.setWidth('100%');
}

}

comp.labelStyle = 'width:300px;padding-left:5px;padding-right:5px';
fields.push(details);
}
}
}
}
},

buttons : [
{
itemId :'submitDocTypeDetails',
//text : common.i18n.getDisplayValue('COMMON_MSG_SUBMIT',"Submit"),
text : 'Submit',
//cls:'hrc-btn-primary',
formBind : true,
handler : function() {
var ischanged = true;
if(getData != null){
pkDocumentTypeAccountMapId = getData.get('pkDocumentTypeAccountMapId');
console.log(getData.get('pkDocumentTypeAccountMapId'));}
else{
pkDocumentTypeAccountMapId="";
}
if(ischanged){
//var waitBox = Ext.MessageBox.wait(common.i18n.getDisplayValue('DMS_SLIMFAST_MAPPED_ROOT_CAUSE_CODES_ADD_MSGBOX','Please wait ...'), common.i18n.getDisplayValue('DMS_SLIMFAST_MAPPED_ROOT_CAUSE_CODES_ADD_MSGBOX_MSG','Saving Document Type Details'));
var waitBox = Ext.MessageBox.wait('Please wait ...', 'Saving Invoice Details');
var params = JSON.stringify(formFieldspanel.getForm().getValues());
Ext.ComponentQuery.query('#submitDocTypeDetails')[0].disable();

Ext.Ajax.request( {
url :'/DMS/slimfast/addMappingDetails.do',
method : 'POST',
params:{
mappedGridData : params,
pkDocumentTypeAccountMapId : pkDocumentTypeAccountMapId
},
success : function(result,request) {
waitBox.hide();
var responseText = Ext.util.JSON.decode(result.responseText);
if((responseText != undefined && responseText.success != null && responseText.success != undefined)){
if(responseText.success==true)
//Ext.example.msg(common.i18n.getDisplayValue('EIPP_COMMON_MSG_STATUS_COLON','Status:'),common.i18n.getDisplayValue('DMS_SLIMFAST_MAPPED_ROOT_CAUSE_CODES_ADD',"Document Type saved successfully"));
Ext.example.msg('Status:',"Saved Successfully!!");
if(responseText.success==false)
//Ext.example.msg(common.i18n.getDisplayValue('EIPP_COMMON_MSG_STATUS_COLON','Status:'),common.i18n.getDisplayValue('CUST_SRCH_FALD','Failed'));
Ext.example.msg('Status:',"Failed!!");
}
win.destroy();
cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getStore().reload();
},
failure : function(result,request) {
waitBox.hide();
//Ext.example.msg(common.i18n.getDisplayValue('DMS_WL_EDIT_DED_STATUS','Status'),common.i18n.getDisplayValue('CUST_SRCH_FALD','Failed'));
Ext.example.msg('Status','Failed');
win.destroy();
}
});

}
else
{
win.destroy();
cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getStore().reload();
//Ext.example.msg(common.i18n.getDisplayValue('DMS_WL_EDIT_DED_STATUS','Status'),common.i18n.getDisplayValue('DMS_SLIMFAST_MAPPED_ROOT_CAUSE_CODES_NO_CHANGES_MSG','No changes to update'));
Ext.example.msg('Status','Failed');
}
}
},
{
text :'Cancel',
cls:'hrc-btn-tertiary-with-border hrc-btn-float-right',
handler : function() {
win.close();
}
}]
});
return formFieldspanel;
}

cms.admin.slimfast.doctype.rad.createPickListGrid = function(id, gridFields, gridStore, gridConfig, memoryProxy, refilterOnStoreUpdate, dataTypeId, compID, rtAlignedFields, encryptedFields, dragDropPlugin) {

var singleSelect = true;
if (gridConfig != undefined) {
//alert(gridConfig.singleSelect);
if (gridConfig.singleSelect != undefined) {
singleSelect = gridConfig.singleSelect;
}
}
if (singleSelect == true || singleSelect == 'SINGLE') {
singleSelect = 'SINGLE';
} else {
singleSelect = 'MULTI';
}
// var selectionModel = new Ext.grid.CheckboxSelectionModel({singleSelect: singleSelect});
var columnsArray = dms.special.component.createColumnModel(gridFields, undefined, gridConfig, dataTypeId, rtAlignedFields);
var forcefit = false;
if (columnsArray.length < 5) {
if (!(!dms.common.isValueEmpty(gridConfig) && !dms.common.isValueEmpty(gridConfig.saveWidths) && gridConfig.saveWidths)) {
forcefit = true;
}

}

var query = {};

gridStore.setRemoteFilter(true);
var regex = /[-s+]/;
var panelConfig;
if (dragDropPlugin == true) {
panelConfig = {
itemId: id.replace(regex, ''),
name: 'Account Custom Mapping Type',
store: gridStore,
columns: columnsArray,
queryString: query,
forceFit: forcefit,
viewConfig: {
deferEmptyText: true,
enableTextSelection: true,
scrollable: {
x: true,
y: true,
listeners: {
scroll: function(scroller, x, y) {
if (scroller.component.up('grid').getHeaderContainer().el.dom.scrollLeft != x) {
scroller.component.up('grid').getHeaderContainer().el.dom.scrollLeft = x;
}
}
}
},
plugins: {
ptype: "gridviewdragdrop"
}
},
selModel: {
selType: 'checkboxmodel',
mode: singleSelect,
allowDeselect: true
},
plugins: singleSelect == 'SINGLE' ? [] : ['PagingSelectionPersistence'] // This needs to be added in respective prod grid where they require
};
} else {
panelConfig = {
itemId: id.replace(regex, ''),
name: 'Account Custom Mapping Type',
store: gridStore,
columns: columnsArray,
queryString: query,
forceFit: forcefit,
selModel: {
selType: 'checkboxmodel',
mode: singleSelect,
allowDeselect: true
},
plugins: singleSelect == 'SINGLE' ? [] : ['PagingSelectionPersistence'] // This needs to be added in respective prod grid where they require
};
}
var grid = Ext.create("extjs6.view.components.SimplePaginatedGridPanel", panelConfig);
if (gridConfig == undefined || gridConfig["attachBeforeLoad"] == undefined)
grid.store.on('beforeload', function(store, recs) {
var data = dms.special.component.getBaseParamsQuery(gridConfig);
for (var i = 0; i < store.getFilters().items.length; i++) {
if (store.getFilters().items[i] != undefined) {
var name = store.getFilters().items[i].config.id;
var value = store.getFilters().items[i].config.value;
var exactMatch = store.getFilters().items[i].config.exactMatch;
var encrypt = false;
if (encryptedFields != undefined && encryptedFields != null) {
encrypt = encryptedFields.indexOf(name) !== -1 ? true : false;
}
if (gridConfig != undefined && gridConfig.isWildCardSearchByDefault == undefined) {
if (dms.master.accountId == 30101 || dms.master.accountId == 70160 || dms.master.accountId == 10328 || dms.master.accountId == 10291) {
gridConfig.isWildCardSearchByDefault = false;
} else {
gridConfig.isWildCardSearchByDefault = true;
}
}
var likeSearchParam = (gridConfig != undefined && gridConfig.isWildCardSearchByDefault) ? '%' + value + '%' : value.replace(/*/g, "%");

if (value != '') {
if (value.substring(0, 2) == "<>" || value.substring(0, 2) == "!=") {
data[name] = [];
data[name].push({
"notEquals": value.substring(2),
"encrypt": encrypt
});
} else if (value.substring(0, 2) == "<=") {
data[name] = [];
data[name].push({
"lessequals": value.substring(2)
});
} else if (value.substring(0, 2) == ">=") {
data[name] = [];
data[name].push({
"greateEquals": value.substring(2)
});
} else if (value.substring(0, 1) == "<") {
data[name] = [];
data[name].push({
"lessThan": value.substring(1)
});
} else if (value.substring(0, 1) == ">") {
data[name] = [];
data[name].push({
"greaterThan": value.substring(1)
});
} else if (value == "null" || (exactMatch && exactMatch == true)) {
data[name] = [];
data[name].push({
"equals": value,
"encrypt": encrypt
});
} else if (dms.master.accountId == 30101 || dms.master.accountId == 70160 || dms.master.accountId == 10328 || dms.master.accountId == 10291) {
data[name] = [];
if (likeSearchParam.indexOf('%') >= 0) {
data[name].push({
"like": likeSearchParam,
"encrypt": encrypt
});
} else {
data[name].push({
"equals": value,
"encrypt": encrypt
});
}
} else {
data[name] = [];
data[name].push({
"like": likeSearchParam,
"encrypt": encrypt
});
}
}
}
}
store.proxy.setExtraParam('query', JSON.stringify(data));
});

//This event will not get fired !!!
grid.on('keypress', function(e) {
console.log('on keypress event');
if (e.getKey() == e.ENTER) {
var data = dms.special.component.getBaseParamsQuery(gridConfig);
gridStore.setBaseParam('query', JSON.stringify(data));
dms.special.component.buildGridRender(grid, gridStore, JSON.stringify(data));
}
});
return grid;
};

cms.admin.slimfast.doctype.rad.createView = function(attributes) {

cms.admin.slimfast.doctype.rad.accountCustomMappingFieldsArray = dms.common.getFields(1, cms.admin.slimfast.doctype.rad.accountCustomMappingDatatypeId, undefined, true);

cms.admin.slimfast.doctype.rad.accountCustomMappingLayoutsList = dms.common.getLayoutsList(cms.admin.slimfast.doctype.rad.accountCustomMappingDatatypeId, true);

cms.admin.slimfast.doctype.rad.accountCustomMappingHeaderArray = cms.admin.slimfast.doctype.rad.accountCustomMappingLayoutsList[1].split(",");

var rs = new Array();
rs['createTime'] = 'rendererForDate';
rs['updateTime'] = 'rendererForDate';

var filterMap = {};

var gridConfig = {
filters: filterMap,
singleSelect: false,
renderers: rs
};

var extraFields = ['pkAccountCustomMappingTypeId'];

var headerMap = {};
for (var j = 0; j < cms.admin.slimfast.doctype.rad.accountCustomMappingHeaderArray.length; j++) {
for (var i = 0; i < cms.admin.slimfast.doctype.rad.accountCustomMappingFieldsArray.length; i++) {
var iArray = cms.admin.slimfast.doctype.rad.accountCustomMappingFieldsArray[i];
if (cms.admin.slimfast.doctype.rad.accountCustomMappingHeaderArray[j] == iArray[0]) {
headerMap[iArray[0]] = iArray[1];
}
}
}

cms.admin.slimfast.doctype.rad.accountCustomMappingStore = dms.common.createStore('AccountCustomMappingGrid', GET_ACCOUNT_CUSTOM_MAPPINGS_URL,
cms.admin.slimfast.doctype.rad.accountCustomMappingFieldsArray, extraFields, null, null, null, true);

cms.admin.slimfast.doctype.rad.accountCustomMappingGrid = cms.admin.slimfast.doctype.rad.createPickListGrid('AccountCustomMappingGrid', headerMap,
cms.admin.slimfast.doctype.rad.accountCustomMappingStore, gridConfig, null, null, cms.admin.slimfast.doctype.rad.accountCustomMappingDatatypeId,
'AccountCustomMappingGrid');

var addActionTab = new Ext.Action({
text: 'Add',
tooltip:'Add New ',
iconCls: 'add-new',
//actionIdentifier:cms.admin.slimfast.doctype.rad.dataTypeId+":"+mappedRootCauseCodesMenuId+":createNewMapping",
handler:function(){
win=Ext.create('Ext.window.Window',{
title:'Add',
id:'newEntryWindow',
width:400,
items:[cms.admin.slimfast.doctype.rad.createLayoutDrivenForm(cms.admin.slimfast.doctype.rad.dataTypeId,null)]
}).show();
}
});

var addButton1 = new Ext.Button(addActionTab);
cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getDockedComponent('toptoolbar').insert(11,'-');
cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getDockedComponent('toptoolbar').insert(12,addButton1);

/*var getData = cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getSelectionModel().getSelection();
if(getData.length==1){
editButton.enable();
}
else{
editButton.disable();
}*/

cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getSelectionModel().on('select', function() {
if (cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getSelectionModel().getSelection().length == 1) {
editButton.enable();
} else {
editButton.disable();
}
});
cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getSelectionModel().on('deselect', function() {
if (cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getSelectionModel().getSelection().length == 1) {
editButton.enable();
} else {
editButton.disable();
}
});
var editActionTab = new Ext.Action({
text: 'Edit',
tooltip:'Edit Existing Document Type',
iconCls:'DMS-Edit-big',//remove-existing
disabled:true,
//actionIdentifier:cms.admin.slimfast.doctype.rad.dataTypeId+":"+mappedRootCauseCodesMenuId+":deleteMapping",
handler: function(){
win=Ext.create('Ext.window.Window',{
title:'Edit',
id:'newEditWindow',
width:400,
items:[cms.admin.slimfast.doctype.rad.createLayoutDrivenForm(cms.admin.slimfast.doctype.rad.dataTypeId,cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getSelectionModel().getSelected().items[0])]
}).show();

}
});

var editButton = new Ext.Button(editActionTab);
cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getDockedComponent('toptoolbar').insert(13,'-');
cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel.getDockedComponent('toptoolbar').insert(14,editButton);



//dms.common.addExportToExcelButton("Mapped Root Cause Codes", [], 17, true, cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel, cms.admin.slimfast.doctype.rad.dataTypeId , mappedRootCauseCodesMenuId);
//dms.common.addExportAllToExcelButton("Mapped Root Cause Codes",[], 19, true,cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel,cms.admin.slimfast.doctype.rad.dataTypeId , mappedRootCauseCodesMenuId);
Ext.apply(cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel, {forceFit: true});
cms.admin.slimfast.doctype.rad.namePanel = Ext.create('Ext.panel.Panel', {
bodyPadding : 5,
items : [cms.admin.slimfast.doctype.rad.DocumentTypeGridPanel]
})

return cms.admin.slimfast.doctype.rad.namePanel;
};

/*cms.admin.slimfast.doctype.rad.getTabPanel = function(attributes){
var mappedRootCauseCodesMenuId = dms.common.findValue(attributes.childIdsOrignal, 'Mapped Root Cause Codes');
cms.admin.slimfast.doctype.rad.tab={
title: common.i18n.getDisplayValue('DMS_SLIMFAST_MAPPED_ROOT_CAUSE_CODES', 'Mapped Root Cause Codes'),
tabIdentifier :mappedRootCauseCodesMenuId!=null?dms.common.accountIdNRoleId+ ":" + mappedRootCauseCodesMenuId:undefined,
items: cms.admin.slimfast.doctype.rad.createView(mappedRootCauseCodesMenuId)
}
return cms.admin.slimfast.doctype.rad.tab;
};*/
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.