jQWidgets Forums

jQuery UI Widgets Forums Grid jqxGrid, celleditend help

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • jqxGrid, celleditend help #28445

    jas-
    Member

    I am attempting to implement the celleditend callback within a column definition like so…

    var computers = {
      source: {
        datafields:[
         { name: 'Hostname', type: 'string' }
        ],
        datatype: 'json'
       },
       { text: 'Hostname',
         datafield: 'Hostname',
         width: '10%',
         validation: function (cell, value) {
         return valHostname(value);
       },
       cellendedit: function(event) {
         console.log(event); //only returns the current row ID
         var d = $('#'+grid).jqxGrid('getrowdata', event); //does not give updated cell value
       }
      },
    

    As you can see from the inline comments the ‘event’ value is that of the current row ID, and the ‘getrowdata’ does not return the updated cell value when cellendedit used as a column definition vs. binding to the ‘cellendedit’ event.

    I would rather not bind the the ‘cellendedit’ event if at all possible. Thanks!

    jqxGrid, celleditend help #28453

    Peter Stoev
    Keymaster

    Hi jas-

    cellendedit – sets a custom function which is called when a cell leaves the edit mode. The Grid passes 5 parameters to it – row index, column data field, column type, old cell value, new cell value. The function can be used for canceling the changes of a specific Grid cell. To cancel the changes, the function should return false.

    { text: ‘Product’, datafield: ‘productname’,
    cellendedit: function (row, datafield, columntype, oldvalue, newvalue) {
    if (newvalue == “My Value”)
    return false;
    }
    }

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.