I have a script which loops through my kendo-grid when an article-id is submitted, this script adds +1 to the quantity when a match is found. After a match is found I want my script to stop looping since the same article-id can have more than 1 row in the grid and the idea is to only add +1 to the first match. I know that a foreach loop can't contain a `break;` and using a for-loop doesn't seem to work for the kendo-grid datarows. Currently the code adds +1 to every matching row. Does anyone know how I can accomplish this?

JS:

```
$('#txtBarcode').submit(function (e) {
    var grid = $("#GCLinesGrid").data("kendoGrid");
    var dataSource = $("#GCLinesGrid").data("kendoGrid").dataSource;
    var allData = grid.dataSource.data();
    var code = this.value;

    $.each(allData, function (index, item) {
        if (item.ArticleCode == code) {
            if (item.CollectedQuantity < item.Quantity) {
                item.CollectedQuantity++;                    
                item.dirty = true;
                dataSource.sync();   
            }
        }
    })
})

```