This is a migrated thread and some comments may be shown as answers.

cancel event of Grid not firing

2 Answers 191 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Florence
Top achievements
Rank 1
Florence asked on 28 Mar 2013, 07:02 PM
Hi everyone, 

I'm trying to handle various grid events.   The grid is setup to use in-line mode editing.  For the most part, everything works good, except for the cancel event on the grid (which should be fire when the user cancels in edit mode in the grid).  Although the documentation lists it as a valid event (http://docs.kendoui.com/api/web/grid#events-cancel),  it is not firing for me.  The change, remove, and save events all fire as expected.  Is this a bug or is something special about this Cancel event?

my grid initialization looks like this:
 
       <table id="jobs" 
               data-role="grid" 
               data-bind="source: jobsList, events: { change: gridChange, cancel: gridCancel, remove: gridRemove, save: gridSave}"
               data-columns="[{ field: 'Id', width: 50, title: 'Id', filterable: true}, { field: 'Name', width: 80, title: 'Name', filterable: true}, { field: 'Description', width: 150, title: 'Description', filterable: true},{ command: ['edit','destroy'], title: '' }]"  
               data-toolbar="[{ name: 'create', text: 'Add new job'}]"
               data-pageable="true"
               data-editable="{mode: 'inline', confirmation: 'Are you sure you want to delete this job?  It will not be recoverable'}"
               data-sortable="true"
               data-column-menu="false"
               data-resizable="true"
               data-selectable="true"
               data-filterable="{ extra: false, operators: { string: { startswith: 'Starts with', eq: 'same as',  neq: 'different' }, number: {eq: '==',  neq: '!=' , gt: '>', lt: '<'}}}"
            >
        </table>

and then i have an observable that the gird gets bound to that implements these methods:

       gridChange: function (eventArgs) {
            //do something
        }, 
        gridRemove: function(eventArgs) {
            //do something 
        }, 
        gridCancel: function(eventArgs) {
            //do something
        },
        gridSave: function(eventArgs) {
            //do something
        }

Again, the change, save, and remove events fire fine but the cancel does not fire.

Any help would be greatly appreciated,

thanks,
Florence

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 29 Mar 2013, 03:46 PM
Hello Florence,

cancel event was added in the Q1 release and will not work with previous version of the framework. Could you please confirm that you are using v2013.1.319 or newer?

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Florence
Top achievements
Rank 1
answered on 04 Apr 2013, 01:30 PM
Apologies for taking so long to respond.  Upgrading to the latest version of Kendo UI Web solved the problem.

Thanks!
Tags
Grid
Asked by
Florence
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Florence
Top achievements
Rank 1
Share this question
or