<script type="text/javascript">
$(function () {
var location = [
{ locationName: 'CITY', locationId: '1' },
{ locationName: 'REMOTE', locationId: '2' }
];
var dataManager = ej.DataManager({
url: "/api/Sites",
adaptor: new ej.WebApiAdaptor(),
offline: true
});
dataManager.ready.done(function (e) {
$("#Grid").ejGrid({
dataSource: ej.DataManager({
json: e.result,
adaptor: new ej.remoteSaveAdaptor(),
insertUrl: "/api/Sites/Insert",
updateUrl: "/api/Sites/Update",
removeUrl: "/api/Sites/Remove",
}),
toolbarSettings: {
showToolbar: true,
toolbarItems: ["add", "edit", "delete", "update", "cancel", "search", "printGrid"]
},
editSettings: {
allowEditing: true,
allowAdding: true,
allowDeleting: true,
showDeleteConfirmDialog: true,
editMode: "dialog"
},
isResponsive: true,
enableResponsiveRow: true,
allowSorting: true,
allowSearching: true,
allowFiltering: true,
filterSettings: {
filterType: "excel",
maxFilterChoices: 100,
enableCaseSensitivity: false
},
allowPaging: true,
pageSettings: { pageSize: 10, printMode: ej.Grid.PrintMode.CurrentPage },
columns: [
{ field: "FS_ID", headerText: 'FS ID', isPrimaryKey: true, defaultValue: '0', visible: false },
{ field: "FS_NAME", headerText: 'Site Name', validationRules: { required: true } },
{ field: "LOCATION_TYPE", headerText: 'Site Type', editType: 'dropdownedit', edit: { params: { value: location } }, validationRules: { required: true } },
],
actionComplete: "complete",
/* actionBegin: "Begin",*/
});
});
});
function complete(args) {
if (args.requestType == 'beginedit') {
$("#" + this._id + "_dialogEdit").ejDialog({ title: "Edit Record" });
}
</script>
Hi Pon selva,
Even in the sample link provided by you, I am getting the same issue.
Also as you can see i am using validationRules property of columns :
{ field: "LOCATION_TYPE", headerText: 'Site Type', editType: 'dropdownedit', edit: { params: { value: location } }, validationRules: { required: true } }
Regards,
Navamy