Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Issues adding a row while the grid has a filter

$
0
0

I have put the below code on my dataSource.  It is inserting the data into the dataSource like it should but the row does not show up on the grid unless I do something on the grid like changing the sort.  Do I need to re-sync the grid with the dataSource?  If so how do I do that?

        change: function (e) {
            if (e.action == "add") {
                var newItem = e.items[0];

                if (this.filter() != undefined) {
                    var filter = this.filter().filters;
                    var i = filter.length;
                    while (i--) {
                        filterValue = filter[i].value;
                        filterField = filter[i].field;
                        switch (filterField) {
                            case "product.textField":
                                newItem.product.textField = filterValue;
                                break;
                            case "product.valueField":
                                newItem.product.valueField = filterValue;
                                break;
                            default:
                                newItem[filterField] = filterValue;
                        }
                    }
                }
            }
        }
 thx!


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>