experts,
any one hlpe me to resolve the below
I have a Kendo grid
in that dropdwon is there
when i select any duplicate item need to raise alert by using java script selected change event
but below code is not working
Ex :


experts,
any one hlpe me to resolve the below
I have a Kendo grid
in that dropdwon is there
when i select any duplicate item need to raise alert by using java script selected change event
but below code is not working
Ex :


Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Naimish MakwanaRank #324 · 7.7K reputationPosted Jan 12, 2023, 3:39 AM EST
Please try below code.
var alreadyItemInGrid = gridData.filter(function(rec) { return rec.MiscellaneousReceipt.MItemId == data; // Filter out the appropriate one })[0]; if(alreadyItemInGrid != null) { ShowErrorMessage("Duplicate record found."); }Thanks
Sachin SinghRank #66 · 26.2K reputationPosted Jan 12, 2023, 3:40 AM EST
modify this line
if(alreadyItemInGrid) {ShowErrorMessage("Item Exists")}to
if(alreadyItemInGrid.length>0) {ShowErrorMessage("Item Exists")}yesubabu kRank #2,091 · 687 reputationPosted Jan 12, 2023, 3:54 AM EST
not working sir
Vishal JoshiRank #377 · 6.7K reputationPosted Jan 12, 2023, 7:14 AM EST
Hello,
You need to check Condition
if(rec.MiscellaneousReceipt.MItemId == data)
because data want this.value() want return MItemId.
You need to use below code to get selected rows.
var rows = grid.select(); var selectedIds = []; $(rows).each(function(){ selectedIds.push($(this).attr("data-uid")) });Now based on selectedIds you can get gridview rows and compare duplicate.
Please refer kendo UI document for the same.
https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/select
Thanks