WWW.DOCX.LIB-I.RU
    -
 

 >>  - .

, . ...

, .

.

ConfItem ParentConfItem , .

DataGrid :

{

"operation":"merge",

"name":"DataGrid",

"values": {

"hierarchical":true,

"hierarchicalColumnName":"ParentConfItem",

"updateExpandHierarchyLevels": {

"bindTo":"onExpandHierarchyLevels"

},

expandHierarchyLevels: {

"bindTo":"expandHierarchyLevels"

}

}

},

, . :

diff :

{

"operation":"insert",

"name":"DataGridActiveRowAddParentRecord",

"parentName":"DataGrid",

"propertyName":"activeRowActions",

"values": {

"className":"Terrasoft.Button",

"caption": resources.localizableStrings.AddChildButtonCaption,

"menu": {

"items": [

{

"tag":"addChildRecordMaterial",

"caption": resources.localizableStrings.MaterialConfItemAddButtonCaption},

{

"tag":"addChildRecordIntangible",

"caption": resources.localizableStrings.IntangibleConfItemAddButtonCaption}

]

},

"style": Terrasoft.controls.ButtonEnums.style.GREY,

"visible":true}

}

Parent:

/**

*

* @param esq

*/

putParentColumn:function(esq) {

if(!esq.columns.contains("ParentConfItem")) {

esq.addColumn("ParentConfItem");

}

},

/**

*

* @param esq*/

addGridDataColumns:function(esq) {

this.callParent(arguments);

this.putParentColumn(esq);

}

onActiveRowChanged:

onActiveRowAction:function(buttonTag, primaryColumnValue) {

this.callParent(arguments);

switch(buttonTag) {

case"addChildRecordMaterial":

{

this.prepareChildRecordConfigMaterial();

break;

}

case"addChildRecordIntangible":

{

this.prepareChildRecordConfigIntangible();

break;

}

}

},

:

/**

*

*/

prepareChildRecordConfigMaterial:function() {

vartypeId = TelecomConstants.ConfItemClasses.Material;

this.addChildRecord(typeId);





},

/**

*

*/

prepareChildRecordConfigIntangible:function() {

vartypeId = TelecomConstants.ConfItemClasses.Intangible;

this.addChildRecord(typeId);

},

/**

*

* @param typeColumnValue*/

addChildRecord:function(typeColumnValue) {

varschemaName =this.getEditPageSchemaName(typeColumnValue);

if(!schemaName) {

return;

}

varselectedItem =this.get("ActiveRow");

vartypeColumnName =this.get("TypeColumnName");

varname = ["ParentConfItem"];

varvalue = [selectedItem];

this.sandbox.subscribe("getCardInfo",function() {

return{

typeColumnName: typeColumnName,

typeUId: typeColumnValue,

valuePairs: [{

name: name,

value: value

}]

};

}, [this.getChainCardModuleSandboxId(typeColumnValue)]);

varexpandedElements =this.get("expandedElements");

this.set("ExpandedLevels", expandedElements);

this.openCardInChain({

schemaName: schemaName,

operation: ConfigurationEnums.CardStateV2.ADD,

moduleId:this.getChainCardModuleSandboxId(typeColumnValue),

valuePairs: [{

name: ["ParentConfItem"],

value: [selectedItem]

}]

});

},

initCardModuleResponseSubscription. :

/**

* .

* .

*/

initCardModuleResponseSubscription:function() {

vareditCardsSandboxIds = [];

vareditPages =this.get("EditPages");

editPages.each(function(editPage) {

vareditCardsSandboxId =this.getChainCardModuleSandboxId(editPage.get("Tag"));

editCardsSandboxIds.push(editCardsSandboxId);

},this);

editCardsSandboxIds.push(this.getCardModuleSandboxId());

this.sandbox.subscribe("CardModuleResponse",function(response) {

vargridData =this.getGridData();

varexpandedElements =this.get("ExpandedLevels");

if(expandedElements){

if(!expandedElements.hasOwnProperty(response.primaryColumnValue)) {

expandedElements[response.primaryColumnValue] = {

page: 0

};

}

this.set("expandedElements", expandedElements);

this.setExpandedItem(response.primaryColumnValue);

this.set("ExpandItemId", response.primaryColumnValue);

this.loadGridData();

this.loadGridDataRecord(response.primaryColumnValue);

this.reloadGridData();

}else{

gridData.clear();

this.loadGridData();

}

},this, editCardsSandboxIds);

},

:

define("HierarchicalSectionUtilities", ["HierarchicalSectionUtilitiesResources","GridUtilitiesV2"],

function(resources) {

Ext.define("Terrasoft.configuration.mixins.HierarchicalSectionUtilities", {

extend:"Terrasoft.BaseObject",

alternateClassName:"Terrasoft.HierarchicalSectionUtilities",

expandedElements: {},

expandHierarchyLevels: {},

ExpandItemId:null,

ExpandedLevels:null,

changeSorting:function() {

this.clearExpandHierarchyLevels();

this.callParent(arguments);

},

/**

* . 蠠* . .

* @protected* @virtual* @param {String} primaryColumnValue

* @param {Boolean} isExpanded , * true - , false

*/

onExpandHierarchyLevels:function(primaryColumnValue, isExpanded) {

if(!isExpanded ||this.isItemExpanded(primaryColumnValue)) {

return;

}

this.setExpandedItem(primaryColumnValue);

this.set("ExpandItemId", primaryColumnValue);

},

/**

*

* @protected

* @overridden

*/

initCanLoadMoreData:function() {

varparentItem =this.get("ExpandItemId");

if(!parentItem) {

this.callParent(arguments);

}

},

/**

*

* @returns {*}

*/

getExpandedItems:function() {

returnthis.get("expandedElements");

},

/**

*

* @param primaryColumnValue*/

setExpandedItem:function(primaryColumnValue) {

(this.getExpandedItems()[primaryColumnValue]) = {"page": 0 };

},

/**

* ,

* @protected* @virtual* @param primaryColumnValue

* @return {boolean}

*/

isItemExpanded:function(primaryColumnValue) {

return!!(this.getExpandedItems()[primaryColumnValue]);

},

/**

*

* @protected

* @virtual

*/

clearExpandHierarchyLevels:function() {

this.set("expandedElements", {});

this.set("expandHierarchyLevels", []);

vargrid =this.getCurrentGrid();

if(grid) {

grid.expandHierarchyLevels = [];

}

},

/**

* ,

* @protected* @virtual* @param {String} itemId

*/

removeExpandHierarchyLevel:function(itemId) {

varexpandHierarchyLevels =this.get("expandHierarchyLevels");

this.set("expandHierarchyLevels", Terrasoft.without(expandHierarchyLevels, itemId));

vargrid =this.getCurrentGrid();

if(grid) {

grid.expandHierarchyLevels = Terrasoft.without(grid.expandHierarchyLevels, itemId);

}

},

/**

*

*

* @overridden* @protected*/

onDeleted:function(result) {

this.callParent(arguments);

if(result.Success) {

this.clearExpandHierarchyLevels();

this.loadGridData();

this.reloadGridData();

}

},

reloadGridColumnsConfig:function(doReRender) {

varprofile =this.get("Profile");

varpropertyName =this.getDataGridName();

vargridProfile = profile[propertyName];

if(!this.Ext.Object.isEmpty(gridProfile)) {

/**

* , , , .

*/

gridProfile.isTiled =false;

gridProfile.type ="listed";

vargrid =this.getCurrentGrid();

if(!grid) {

return;

}

grid.type = gridProfile.type;

varviewGenerator = Ext.create("Terrasoft.ViewGenerator");

viewGenerator.viewModelClass =this;

vargridConfig;

varbindings =this.Terrasoft.deepClone(grid.bindings);

if(gridProfile.type === Terrasoft.GridType.LISTED) {

gridConfig = {

listedConfig: Ext.decode(gridProfile.listedConfig),

type: gridProfile.type};

viewGenerator.actualizeListedGridConfig(gridConfig);

grid.captionsConfig = gridConfig.listedConfig.captionsConfig;

grid.columnsConfig = gridConfig.listedConfig.columnsConfig;

grid.listedConfig = gridConfig.listedConfig;

grid.initBindings(gridConfig.listedConfig);

}else{

gridConfig = {

tiledConfig: Ext.decode(gridProfile.tiledConfig),

type: gridProfile.type};

varisVertical = (propertyName.indexOf("VerticalProfile") > -1);

gridConfig.isVertical = isVertical;

grid.isEmptyRowVisible = !isVertical;

viewGenerator.actualizeTiledGridConfig(gridConfig);

grid.columnsConfig = gridConfig.tiledConfig.columnsConfig;

grid.tiledConfig = gridConfig.tiledConfig;

grid.initBindings(gridConfig.tiledConfig);

}

grid.bindings = bindings;

if(doReRender) {

grid.clear();

grid.prepareCollectionData();

if(grid.rendered) {

grid.reRender();

}

}

}

}

});

returnTerrasoft.HierarchicalSectionUtilities;

}

);

( . :

// ,

#ProductsSectionGridDataViewContainer.grid-fixed-col,

#ConfItemSectionGridDataViewContainer.grid-fixed-col,

#ProductCatalogueLvlSectionV2GridDataViewContainer.grid-fixed-col

{

padding-left:24px;

}

.

 >>  - .



:

- ...

4 2014 . N 41 2.4.4.3172-14 - , ...

17 : : , , , . . . . :1. : : ( , ), , . : ...

09.07.1987 03.30 . , ( ) (, , , ...

, , 1 2014 . 31 2014 . N / , , ...

. . ( ) RodionovMB.ru , . I , , , ? . ...

. , ...

. , - , ...

1 5 1. : Name, cat, zoo, forest, mother, father, he, she, elephant, house, farm, dog, cat, boy, girl, mouse, fox, pig, monkey, fish, football, ski, skate, tennis, b...

/ KRDU : . 2...







 
<<     |    
2017 www.docx.lib-i.ru - -

, .
, , , , 1-2 .