<ej-grid id="FlatGrid"
allow-paging="true"
allow-filtering="true"
filter-settings="@(new FilterSettings() { FilterType=FilterType.Excel})"
action-begin="onBegin"
allow-sorting="true">
. . .
</ej-grid>
<script type="text/javascript">
function onBegin(args) {
if (args.requestType == "save") {
//Assign the customized value
args.data.ReferenceId = 5;
args.data.ReferenceTypeId = 6573;
}
}
</script> |
Thanks Saravanan A.
Will try to implement it, btw why after i perform the grid action (save / edit / update), the grid content not refresh.
<ej-grid id="FlatGridmaklumatRawatan"
allow-paging="true"
allow-filtering="true" filter-settings="@(new FilterSettings() { FilterType=FilterType.Excel}) "
action-complete="oncomplete"
action-begin="oncomplete"
allow-sorting="true">
<e-datamanager json="ViewBag.datasourceTreatmentProfile"
update-url="/Medical/SaveTreatmentProfile"
insert-url="/Medical/SaveTreatmentProfile"
remove-url="/Medical/SaveTreatmentProfile"
adaptor="remoteSaveAdaptor" />
<e-edit-settings allow-adding="true" allow-editing="true" allow-deleting="true" dialog-editor-template-id="#templateJHProfile" edit-mode="@(EditMode.Normal)"></e-edit-settings>
<e-toolbar-settings show-toolbar="true" toolbar-items="@(new List<string>() {"edit","update","cancel" })"></e-toolbar-settings>
<e-columns>
<e-column field="JhId" header-text="Action" is-primary-key="true" width="30" visible="false"></e-column>
<e-column field="ReferenceId" header-text="Action" is-identity="true" is-primary-key="true" width="30" visible="false"></e-column>
<e-column field="ReferenceTypeId" header-text="Action" is-identity="true" is-primary-key="false" width="30" visible="false"></e-column>
<e-column id="ReferencedropDown" field="ReferenceTypeDesc" header-text="Penyakit" is-primary-key="true" width="250" visible="false"></e-column>
<e-column field="Description" header-text="Keterangan Penyakit" is-primary-key="true" width="70"></e-column>
<e-column field="StatusRawatanPenyakit" header-text="Status" edit-type="@(EditingType.BooleanEdit)" width="25"></e-column>
</e-columns>
</ej-grid>
<script type="text/javascript">
function oncomplete(args) {
if (args.requestType == "edit") {
args.refreshContent();
}
}
</script>
<ej-grid id="FlatGridmaklumatRawatan"
allow-paging="true"
allow-filtering="true" filter-settings="@(new FilterSettings() { FilterType=FilterType.Excel})"
action-begin="onBegin"
allow-sorting="true">
. . .
</e-columns>
</ej-grid>
<script type="text/javascript">
function onBegin(args) {
if (args.requestType == "save" && args.action == "add") {
args.data.OrderID = uniqueValue;
}
}
</script> |