AUTHOR: Eyup Yusein
DATE POSTED: September 27, 2018
DESCRIPTION
There are scenarios where it might be helpful to know whether the currently opened grid cell in Batch editing is from a new row or already existing one. Here are some samples: 1. When you want your users to be able to insert but not to edit records, or vice versa. 2. When you want to save user changes to database explicitly and want to determine whether they are coming from new or already existing row. 3. When you want to prefill some values in insert mode depending on other field values.
SOLUTION
<
ClientSettings
>
ClientEvents
OnBatchEditOpened
=
"batchEditOpened"
/>
</
function
batchEditOpened(sender, args) {
args.get_tableView().get_dataItems();
var
item = args.get_row().control;
if
(item.get_itemIndex() < 0) {
// new row
// execute custom logic
}
Resources Buy Try