Hi Venkatesh Ayothiraman
Thanks for the feedback.
Based on the guideline that has been shared, i able to perform if using the EditMode = "InlineForm", base on my situation now; i try to use EditMode = "InlineFormTemplate" so i can customize the form to hide some of the field that are not required
<e-edit-settings allow-adding="true" allow-editing="true" allow-deleting="true" edit-mode="@(EditMode.InlineFormTemplate)" inline-form-template-id="#template" />
You can see the below code, that i have some of the element :
1. ReferenceId = textbox
2. Diagnosis Date = DatePicker
3. Diagnosis Type = dropdown
4. Diagnosis Name = textbox
<e-columns>
<e-column header-text="Reference Id" field="DiagnosisDetailsId"
is-primary-key="false"
is-identity="true"
disable="true"
value="{{:DiagnosisDetailsId}}"/>
<e-column header-text="Diagnosis Date"
field="DiagnosisDateDesc"
edit-type="@(EditingType.Datepicker)"
value="{{:DiagnosisDateDesc}}"/>
<e-column header-text="Diagnosis Type"
field="DiagnosisTypeId"
foreign-key-field="DiagnosisTypeId"
foreign-key-value="DiagnosisTypeDesc"
datasource="@ViewBag.cmbDiagnosisType"
value="{{: DiagnosisTypeDesc}}"/>
<e-column header-text="Diagnosis Name"
field="DiagnosisName"
is-primary-key="true"
value="{{:DiagnosisName}}"
/>
</e-columns>
While using the InlineFormTemplate, for the text box i' using this line, so it's properly bind from the grid into the field
<input id="DiagnosisCode" name="DiagnosisCode" value="{{: DiagnosisCode}}" disabled="disabled" class="e-field e-ejinputtext valid e-disable"
style="text-align: right; width: 116px; height: 28px" />
Currently my issues,
1. I can't bind the drop down value and datetime from the grid into the template form
2. Can't display the drop down value into the template form
I try using this code for the drop down
@Html.DropDownListFor(model => model.NaturalId, ViewBag.lNatural as SelectList, "Select", new { @value = "DiagnosisTypeDesc", htmlAttributes = new { @class = "form-control" }, style = "width: 100%;height: 14px;display: block;font-size: 11px;line-height: 1.428571429;color: #555;vertical-align: middle;background-color: #fff;border: 1px solid #ccc;" })
Able to load the drop down but can't bind the grid value into this field.
Appreciate you help.
Thanks
function actionComplete(args) {
if ((args.requestType == "beginedit" || args.requestType == "add") && args.model.editSettings.editMode == "inlineformtemplate") {
//rendered the numeric textbox
$("#Freight").ejNumericTextbox({ value: parseFloat($("#Freight").val()), width: "116px", decimalPlaces: 2 });
//Create a Dropdown control
$("#ShipCountry").ejDropDownList({ width: '116px' });
if (args.requestType == "beginedit") {
$("#OrderID").attr("disabled", "disabled");
//here set the Dropdown value based on selected record
$("#ShipCountry").ejDropDownList("setSelectedValue", args.row.children().eq(3).text());
}
$(".e-field").css({ 'width': '116px', 'text-align': 'left' });
}
} |