In Add mode the name 'Link Type' is not showing for the dropdown columnAlso, is there a way to hide a column is ADD and Edit mode only?public editSettings: EditSettingsModel = { allowEditing: false, allowAdding: true, allowDeleting: true, mode: 'Dialog' };<ejs-grid [editSettings]='editSettings' [toolbar]='toolbar'(toolbarClick)='clickHandler($event)' [dataSource]='aEpicLinks'[allowPaging]='true' [allowSorting]='true' [pageSettings]='pageOptions'(commandClick)='commandClickLink($event)' (actionBegin)='actionBegin($event)'(actionComplete)="actionComplete($event)"(rowSelected)='rowSelectedLink($event)' [allowFiltering]='true'[filterSettings]='filterOptions'><e-columns><e-column field='itemDependencyAssociationId' textAlign='Left' width=90[visible]='false' defaultValue='0' >e-column><e-column field='linkType' headerText='Link Type' textAlign='Left' width=90[edit]='ddParamsP'>e-column><e-column field='name' headerText='Link Name' textAlign='Left' width=90>e-column><e-column headerText='' width=140 [commands]='commandsLink'>e-column>e-columns>ejs-grid>this.ddParamsP = {create: () => {this.elem = document.createElement('input');return this.elem;},read: () => {console.log("Read");return this.dropdownObj.value;},destroy: () => {this.dropdownObj.destroy();},write: (args: { rowData: any, column: any }) => {this.dropdownObj = new DropDownList({dataSource: <any>this.assocTypesData, value: (args.rowData as any).linkType, fields: { text: 'name', value: 'id' }});this.dropdownObj.appendTo(this.elem);}}this.getAssociationTypes();}
|
[normal-edit.component.ts]
this.editparams = {
create: () => {
this.elem = document.createElement("input");
return this.elem;
},
read: () => {
return this.dropdownObj.text;
},
destroy: () => {
this.dropdownObj.destroy();
},
write: args => {
var label = document.createElement("label");
label.innerText = "CustomerID";
label.style.color = "rgba(0, 0, 0, 0.42)";
label.style.fontWeight = "400";
args.element.parentElement.appendChild(label);
var brelem = document.createElement("br");
args.element.parentElement.appendChild(brelem);
args.element.parentElement.appendChild(this.elem);
this.dropdownObj = new DropDownList({
dataSource: <any>orderDatas,
value: (args.rowData as any).OrderID,
fields: { text: "CustomerID", value: "OrderID" }
});
this.dropdownObj.appendTo(this.elem);
}
}; |
It is rendering bit differently for me,The 1st dropdown select icon on left sideThe 2nd dropdown label is below dropdownAnd i see a new line before Save button<ejs-grid [editSettings]='editSettings' [toolbar]='toolbar'(toolbarClick)='clickHandler($event)' [dataSource]='aEpicLinks'[allowPaging]='true' [allowSorting]='true' [pageSettings]='pageOptions'(commandClick)='commandClickLink($event)' (actionBegin)='actionBegin($event)'(actionComplete)="actionComplete($event)"(rowSelected)='rowSelectedLink($event)' [allowFiltering]='true'[filterSettings]='filterOptions'><e-columns><e-column field='linkType' headerText='Link Type ' textAlign='Left' width=90[edit]='ddParamsP'>e-column><e-column field='name' headerText='Link Name' textAlign='Left' width=90[edit]='ddParamsTasks'>e-column><e-column headerText='' width=140 [commands]='commandsLink'>e-column>e-columns>ejs-grid>this.ddParamsP = {create: () => {this.elem = document.createElement('input');return this.elem;},read: () => {console.log("Read");return this.dropdownObj.value;},destroy: () => {this.dropdownObj.destroy();},write: (args) => {var label = document.createElement("label");label.innerText = "Link Type";label.style.color = "rgba(0, 0, 0, 0.42)";label.style.fontWeight = "400";args.element.parentElement.appendChild(label);var brelem = document.createElement("br");args.element.parentElement.appendChild(brelem);args.element.parentElement.appendChild(this.elem);this.dropdownObj = new DropDownList({dataSource: <any>this.assocTypesData, value: (args.rowData as any).linkType, fields: { text: 'name', value: 'id' }});this.dropdownObj.appendTo(this.elem);}}this.ddParamsTasks = {create: () => {this.elemTasks = document.createElement('input');return this.elemTasks;},read: () => {console.log("Read");return this.dropdownTasksObj.value;},destroy: () => {this.dropdownTasksObj.destroy();},write: args => {var label = document.createElement("label");label.innerText = "Tasks ";label.style.color = "rgba(0, 0, 0, 0.42)";label.style.fontWeight = "400";args.element.parentElement.appendChild(label);var brelem = document.createElement("br");args.element.parentElement.appendChild(brelem);args.element.parentElement.appendChild(this.elem);this.dropdownTasksObj = new DropDownList({dataSource: <any>this.tasksData, value: (args.rowData as any).itemName, fields: { text: 'itemName', value: 'itemId' }});this.dropdownTasksObj.appendTo(this.elemTasks);}}}I added one more dropdown to your example
|
[app.component.html]
<ejs-grid #grid [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings'
(actionComplete)="actionComplete($event)" [toolbar]='toolbar'>
<e-columns>
<e-column field='ShipCountry' headerText='ShipCountry' width='120' [edit]='shipCountryparams'
[validationRules]="shipcountryValidation"></e-column>
<e-column field='CustomerID' headerText='Customer ID' width='150' [edit]='editparams'>
</e-column>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' isPrimaryKey='true'>
</e-column>
</e-columns>
</ejs-grid>
[app.component.ts]
export class NormalEditComponent implements OnInit {
@ViewChild("grid")
public grid: GridComponent;
this.shipcountryValidation = {
required: true
}; |