Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
igGrid integration with knockoutjs
posted

I am following the sample "igGrid integration with knockoutjs" , what am doing is i have following markup

<table id="grid1" data-bind="igGrid: {dataSource: viewModel, width: 1100, height: 500, primaryKey: 'ProductID', autoCommit: false,

                                features: [
                                            {
                                                name: 'Updating', editMode: 'row',
                                                columnSettings: [
                                                                    {
                                                                         columnKey: 'ProductID',
                                                                         editorOptions: {readOnly: true}
                                                                    }
                                                                ]
                                            },
                                            {name: 'Sorting',type: 'local'},
                                            {name: 'Paging',type: 'local',pageSize: 10},
                                            {
                                                    name: 'Tooltips',
                                                    columnSettings: [
                                                        { columnKey: 'ProductID', allowTooltips: false },
                                                        { columnKey: 'Name', allowTooltips: true },
                                                        { columnKey: 'ProductNumber', allowTooltips: true }
                                                ],
                                                style: 'popover',
                                                visibility: 'always',
                                                showDelay: 1000,
                                                hideDelay: 500
                                            }
                                ],
                                autoGenerateColumns: false,
                                columns: [


                                    {key: 'ProductID', headerText: 'Product ID', width: 80, dataType: 'number'},
                                    {key: 'Name', headerText: 'Name', width: 150, dataType: 'string'},
                                    {key: 'ProductNumber', headerText: 'Product Number', width: 100, dataType: 'string'},
                                    
                                ]
                          }">

</table>

and have following script

$("#grid1").live("iggridupdatingdatadirty", function (event, ui) {
            $("#grid1").igGrid("commit");
            //saving local changes to the datasource when sorting
            return false;
 });

Now the issue is after sorting , if i try to update a record e.g in my case i update a name then it updates that record plus another record with the same name, this only happens after sorting, otherwise it works great.

Any help would be appreciated !